Re: header() problem!!!!
| From: | Jim lucas | Date: | Wed, 11 Sep 2002 08:33:10 +0000 |
| Subject: | Re: header() problem!!!! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-115940@lists.php.net to get a copy of this message | ||
This is not a bug. This is just one of many differances between the big
browser war. With Netscape (not sure which versions), the attachment thing
I found is required. But with IE it kills the browser.
<?
define('MSIE', (preg_match("/msie/i", $_SERVER['HTTP_USER_AGENT])?1:0));
header("Cache-Control: no-cache, must-revalidate");
header("Content-Type:".$mime_type);
header("Content-Disposition: ".(MSIE?'':'attachment;
')."filename=$filename");
echo $filedata;
?>
----- Original Message -----
From: "xdrag" <xdrag@zjuem.zju.edu.cn>
To: "PHP Mailing List" <php-general@lists.php.net>
Sent: Saturday, September 07, 2002 7:38 PM
Subject: [PHP] header() problem!!!!
> Hi:
> is this a bug?
> [win98se + apache2.0.40 + PHP4.2.3 + IE6.0]
>
> download1.php:
> <?php
> ...
> header("Cache-Control: no-cache, must-revalidate");
> header("Content-Type:".$mime_type);
> header("Content-Disposition: filename=$filename");
> echo $filedata;
> ?>
> works well....
>
> download2.php:
> <?php
> ...
> header("Cache-Control: no-cache, must-revalidate");
> header("Content-Type:".$mime_type);
> header("Content-Disposition: attachment; filename=$filename");
> echo $filedata;
> ?>
> please pay attention to header("Content-Disposition: ...")
> if you click this URL, for example "download2.php?id=1", then click the
"save" button,
> your browser will suffer a fatal error. You can not do anything else now!
>