ZIP File error.

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
hari.rao
Forum Newbie
Posts: 11
Joined: Mon Mar 06, 2006 7:07 pm
Location: Malaysia

ZIP File error.

Post 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
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

looks like you forgot the closing ) on your $zipfile->addFile() lines ;)
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
hari.rao
Forum Newbie
Posts: 11
Joined: Mon Mar 06, 2006 7:07 pm
Location: Malaysia

the same zip file problem

Post 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.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

$zipTest = new zipfile();

did you include the zipfile class?

if so, is zipfile() the name of the class?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Post by s.dot »

oh, duh

your $zipfile-> lines should be $zipTest->
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
hari.rao
Forum Newbie
Posts: 11
Joined: Mon Mar 06, 2006 7:07 pm
Location: Malaysia

ZIP File error.

Post 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..??
Post Reply