note 44942 added to function.header
| From: | spam dot havard at hvassing dot com | Date: | Fri, 20 Aug 2004 18:23:09 +0000 |
| Subject: | note 44942 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-75018@lists.php.net to get a copy of this message | ||
A short comment to what isaac at blueapples dot org wrote.
My image script wasn't cooperative at all when I used this code:
<?php
header("Content-Type: " . $image_type . "");
?>
When I altered it to the following:
<?php
header("Content-type: " . $image_type . "");
?>
everything worked out just fine.
Although the best code for this might be:
<?php
$agent = trim($_SERVER['HTTP_USER_AGENT']);
if ((preg_match('|MSIE ([0-9.]+)|', $agent, $version)) || (preg_match('|Internet
Explorer/([0-9.]+)|', $agent, $version)))
{
header("Content-type: " . $image_type . "");
}
else
{
Header("Content-Type: " . $image_type . "");
}
?>
I use Windows XP Pro SP2
and Internet Explorer (Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1))
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+44942
Delete -- http://master.php.net/manage/user-notes.php?action=delete+44942&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+44942&report=yes
Search -- http://master.php.net/manage/user-notes.php