Hi.
I'm rather confused with forcing a download. I just want to save dynamic content (from $_SESSION[''] data) as a .html file.
The script to do this is a PHP page, but when I click on "download" it downloads as "download.php"
Here's the code:
Code: header("Cache-control: private"); //IE 6 Fix
if (isset($_GET['download']) && $_GET['download']=="true" && isset($_GET['filename']) && $_GET['filename']!="") {
// retrieve content of the file here, e.g. from a database...
$content=$_SESSION['old_page'];
// send the header here
header('Content-type: text/plain');
header('Content-Disposition: attachment; filename="' . $_GET['filename']);
// put the content in the file
echo($content);
// stop processing the page
exit;
}
It's accessed using: Code: <a href="../outputs/download_as_file.html?download=true&filename=shine_output.html">Download</a>
Any suggestions? I found a good tutorial here: http://richardlynch.blogspot.com/2006/06/php-downloads-content-disposition.html but don't think it'll do what I need to do
firefox wouldnt stream mp3 files completely from my php page
hi everyone,I have a php file trying to read and stream mp3 files. It works fine in IE but my problem is Firefox streams only 3 seconds of them.$direction =
help removing unwanted graphic
How do I remove the small elongated rectangular shape between the "Latest post" and "Archives" section at http://www.simonlindgren.com ?The code surrounding this place
Facebook status update API
Hello,So, I'm trying to create my first Facebook application with PHP.Basic ideas for my application:My website includes feature called “tip of the week" and i would like to create a code
Output Buffering question
Hi all, I've been trying to wrap my head around output buffering. So far I've found tons of benifits but I'm wondering about the downside of output buffering. Problems it creates, whether or not it
Hi, explode and strstr.
Hi, I seem to be confused about the strstr function, eg. i have a string like:"a.b.c.d.e.f""a.b.c.d.e"I always want it to split at the second "." from the end, so
Sort a two dimensional array.
Hi. I've set up a two dimensional array that reads as follows:Code: $modifiedData = array( array($arrCollingwoodStart[0], $numCollingwoodForTotal, $numCollingwoodAgainstTotal,
Web Application Recipe
Hi Guys! I am working with the Web Application recipes. I am currently working on the send password page. The page is working, but I sends the same password and username regardless of the email
SuperCali PHP Event Calendar
does anyone have any experience with the SuperCali PHP Event Calendar? I could use some assistance in writing a custom function for it, anyone ever messed with it before?
Structure Question - One Table or One Table Per Record Set?
I have a web app (mySQL and PHP) which allows people to create an item with up to 200 records which I store in a single table. Any user subscribing to that item will be pulling up to 4 records from
sendmail code suddenly not working
Hi Guys, I maintain 3 sites (including my own) I use the following code from a french webmaster that gave me permission to use it. He designed & coded one of them. Now the code seems to have