Page 1 of 1

Need Help With making file

Posted: Thu Jan 19, 2006 10:02 am
by IRCfrog
I run a search engine called IRC frog and when it lists the file name, it has info like network and other stuff (http://www.ircfrog.com) I need a way to creat a file on the fly (not saved anywhere on my hosting) with info from MySQL. I was thinking this can be done by knowing the id of the result then you click the link that something like whatever.php?15 < id of the entry then the whatever.php takes info from that entry and makes the file for download but is not saved on my hosting. I cant save each file b/c i have over 100,000 results but if you need to do it that way i am all up for it.

Thanks alot guys! My aim is JuG Ownzor

Posted: Thu Jan 19, 2006 2:39 pm
by raghavan20
you want something like...
search result 1 download file
search result 2 download file
search result 3 download file

If the user clicks on any of the download file, then a file containing information of that particular search result has to be downloaded...

If what I have said is right, then
for every download file link, provide the id of the entry as url parameter

When the user clicks on the 'download file' link,
get the id,
search the db,
get the record,
use file write functions and write appropriate information into it
save it by giving a temp name, may be $sessionid_temp.txt
you have to set 'content disposition' as attachment in header(), which would enable you to download.
delete the file after the end of every session.

Look here to find out how to write a script to allow downloading a file.