[thelist] Zip files on server (PHP / Linux)

Richard Livsey R.Livsey at cache-22.co.uk
Thu Jan 25 13:49:31 CST 2001


I am trying to zip up a directory of files server side using PHP on a Linux
platform.

How would I go about doing this?

Thanks.

I've been hanging round here for a little over 6 months and haven't posted
anything until now.
Here's a tip to say thanks for such a great resource!

<tip type="PHP" author="Richard Livsey">
When using variables in your code to do anything for security, make sure you
check where the values came from.
As PHP parses the POST and GET automatically anyone can supply variables to
the program without your knowledge.
For example - if you have a check to make sure the user is logged in :

if ($isLoggedIn)
{
	# stuff
}

this is insecure as anyone can simply do :
http://domain/page.php?isLoggedIn=true
If the value was meant to come from a session object or something, make sure
that you check that it actually came from there. Also never do the above
(just checking if a var is true) - set it to some value that you can test
for, such as the MD5 sting of the current date.
</tip>

R.Livsey
Freelance web developer
Vibus.net Director
Lead programmer for Tickle.co.uk
m. +44 (0) 7714 757250
e. R.Livsey at Cache-22.co.uk





More information about the thelist mailing list