Re: Request for Help/Information
| From: | John Holmes | Date: | Wed, 04 Aug 2004 14:18:49 +0000 |
| Subject: | Re: Request for Help/Information | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-192707@lists.php.net to get a copy of this message | ||
Andy Baldwin wrote:
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")))) {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.comheader("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);