Page 1 of 1

ZIP File error.

Posted: Thu Mar 09, 2006 1:14 am
by hari.rao
Hai guys....need ur expert help. i have coded for the php page to zip automatically. but im facing this problem. its just like 1% of error only be4 im successfull. pls help me. i will paste the code and the error msg below. thanks alot guys. pls reply me soon.


<?php

include("include/function.php");
include("include/required.php");
$zipTest = new zipfile();

$zipfile->add_dir("/");
$zipfile->add_file($rootdir."Kodak_all_repair_jobs-". date(Ymd).".xls";
$zipfile->add_file($rootdir."Kodak_backorder-". date(Ymd).".xls";

$filename = "[KODAK]DAILY_REPORT(". date(Ymd) .").zip";
$fd = fopen ($filename, "wb");
$out = fwrite ($fd, $zipfile -> file());
fclose ($fd);
?>


error msg.
Parse error: parse error, unexpected ';' in C:\Inetpub\wwwroot\webreport\kodak_test\ziploct.php on line 10

Posted: Thu Mar 09, 2006 1:22 am
by s.dot
looks like you forgot the closing ) on your $zipfile->addFile() lines ;)

the same zip file problem

Posted: Thu Mar 09, 2006 1:44 am
by hari.rao
hey..thanks man for the help. but unfortunatly after fixing it got another new problem. hehe...it's like this.

Fatal error: Call to a member function on a non-object in C:\Inetpub\wwwroot\webreport\kodak_test\ziploct.php on line 8

what does this mean and how to fix it.

Posted: Thu Mar 09, 2006 1:46 am
by s.dot
$zipTest = new zipfile();

did you include the zipfile class?

if so, is zipfile() the name of the class?

Posted: Thu Mar 09, 2006 1:50 am
by s.dot
oh, duh

your $zipfile-> lines should be $zipTest->

ZIP File error.

Posted: Thu Mar 09, 2006 1:54 am
by hari.rao
hei man...thanks ina million.. but now the f**ked part is my excel file is not getting into the zip folder. u know y..??