|
Posted by Brian on 05/26/05 04:44
This site I am working on is driving me up the F*****g wall ! , sorry just
needed to get
that of my chest
I have site that run a MySQL query, there are many permutations of this
query depending
on what the users asks for (about 50 I think).
I also need to save the queryed results into a CSV file and zip it on the
fly. I have the
code to do this (makezip.php), first of all I tried sending the MySQL query
to makezip.php
, this didn't work (see post Re: sending a MySQL query) so I am now trying a
different way.
search.php runs the search and displays the results on the screen. It also
creates a var called $filedata,
the var is the data to be zipped up
makezip.php has the class to make the zip file.
what I was trying to get the following to work........
run the search.php, this give me the var $filedata I need. Have a link on
this page to
another file called savezip.php, this links runs another page called
savezip.php that
calls the below code.
(the code needed to exicute making a zip file)
include("search.php");
include("makezip.php");
$zipfile = new zipfile();
$zipfile -> add_file($filedata, "test.csv");
header("Content-type: application/octet-stream");
header("Content-disposition: attachment; filename=newtest.zip");
echo $zipfile -> file();
I was hopping that when the link is clicked it run, it would read the var
$filedata from the search.php
and create the zip file for downloading, instead the savezip.php is reading
in and displaying
the search.php.
I can't past the $filedata to save.php as its way to big, How can I get
round this? How can I get the
savezip.php to read the $filedata from search.php but without including the
whole script?
Once again thanks in advance,
Brian
Navigation:
[Reply to this message]
|