![]() |
PHP to ZIP a directory.
I need to zip all the files in a directory (not including the folder). i tried to use an example on www.php.net/sip to help me but i get a parse error. heres the whole code i have. The SQL statments insert it into a PHP nuke evo database. it already puts the files in the downloads section but i want it to include the ZIP file (as if to download all files).
:
<?phpthe parse error i get is: Parse error: parse error, expecting `'('' in /Users/mike/sites/untitled folder/index.php on line 37 line 37 is: if ($zip->open($filename1, ZIPARCHIVE::CREATE)!==TRUE) { usually parse errors are easy to solve but i dont really know what im doing with the zip code. Thanks in advance, Piercy |
Hi,
I didn't examine the code very in-depth, but I do see that you are probably going to have some problems where you attempt to include the contents of variables into parameters and or strings. an example would be :
how about trying this instead :
there are other occurrences in this code where you do similar things with your variables. try fixing these up and then post back what you get and we'll work on the next step. |
currently rewriting the whole code to fix these errors and a few other ones. will carry on with zipping once i fixed it.
Thanks for help, |
Would someone be able to supply a general zipping code for zipping a whole directory? This should help me then i can add it to what ive got.
|
| All times are GMT -5. The time now is 1:34 AM. |
Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC