Would someone be willing to suggest a solution to a coding problem?
After the following code (downloads a text file from the host server to
my PC), how can I redirect the script to another one?
<?php
$user_agent = strtolower($_SERVER["HTTP_USER_AGENT"]);
header("Content-type: application/force-download" );
if((is_integer(strpos($user_agent,"msie"))) &&
(is_integer(strpos($user_agent,"win")))) {
header("Content-Disposition: filename=" . $filename);
} else {
header("Content-Disposition: attachment; filename=" . $filename);
}
header("Content-Description: File Transfer");
@readfile($filename);
?>
I have tried without success:
header("Location: Echo_UploadBatch.php?filename=" . $filename);
You'll need to use a JavaScript or Refresh meta tag to do the redirection since you've already sent content by downloading the file. You won't be able to use a header() style redirection.
--
John Holmes
php|architect - The magazine for PHP professionals - http://www.phparch.com
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php