Hello everyone,
I've got an app that allows people to create an html newsletter from a template. When they click "publish," it sends a new page header to ask them to download the file:
header("Expires: Thu, 31 Aug 2000 05:00:00 GMT"); // always expired
header("Last-Modified: " . gmdate("D, d M Y H:i:i") . " GMT"); // always just modified
header("Cache-Control: no-store, no-cache, must-revalidate");
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
header("Cache-control: private");
header("Content-Type: application/octet-stream");
header("Content-Disposition: attachment; filename=$filename");
header("Content-Length: " . strlen($x));
// output the newsletter html for download
print $newsletter;
You enter your form and hit submit. The new page headers are sent followed by the content to be downloaded, and the download dialog displays, as it should. But the original form stays up on the screen. How do I redirect to a new page? I've already sent headers, so I don't know how to do this.
I've tried putting this in the headers:
header("Refresh: 1; URL=http://localhost/index.php");
But it has no effect.
Any ideas?