Page 1 of 1
Create A HTML File
Posted: Sun Feb 19, 2006 4:32 pm
by icesolid
I want to have PHP create a HTML file temporarily for the user to view and once the user closes the page it is deleted.
Posted: Sun Feb 19, 2006 4:35 pm
by josh
Why not just output the HTML
Download Option
Posted: Sun Feb 19, 2006 4:46 pm
by icesolid
Because I want to provide the user with an option to download the output they are looking at.
Posted: Sun Feb 19, 2006 4:52 pm
by feyd
you can regenerate the file for them to download...
Dynamic Files
Posted: Sun Feb 19, 2006 4:57 pm
by icesolid
The output on this file is going to be dynamic it is going to change depending on their ticket information.
I dont want to have 100,00 HTML files on the server, I just want a temporary HTML file that fills in their ticket information for them to download.
Posted: Sun Feb 19, 2006 5:00 pm
by feyd
you never have to save the html to a file. You regenerate the html on the fly and tell the browser to download it. It's really quite simple.
Look through the
header() function, which has some examples of making downloads.
Posted: Sun Feb 19, 2006 6:56 pm
by nickman013
Or you can mail it to them.
Posted: Sun Feb 19, 2006 8:18 pm
by MinDFreeZ
yea... basically it's all been said.. u never need to actually save the html file.... let PHP generate it.. u can change this "ticket" thing all day and it will still output fine... u can always add a little javascript print button - not sure how u plan on having them download it..