note 28129 added to function.header
| From: | jagarian at freechal dot com | Date: | Fri, 03 Jan 2003 10:22:46 +0000 |
| Subject: | note 28129 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-41592@lists.php.net to get a copy of this message | ||
add header php to excel~~~~ download file~
//####################################
$user_agent=${"HTTP_USER_AGENT"};
if ((strpos($user_agent,"MSIE") ? strpos($user_agent,"MSIE")+1 : 0)>0)
{
if ((strpos($user_agent,"MSIE 5.0") ? strpos($user_agent,"MSIE 5.0")+1 :
0)>0)
{
$content_disp="attachment;filename=";
$contenttype="application/vnd.ms-excel";
}
else
{
$content_disp="attachment;filename=";
$contenttype="application/vnd.ms-excel";
}
}
else
{
$content_disp="attachment;filename=";
$contenttype="application/vnd.ms-excel";
}
header("Content-Disposition".": "."attachment;filename=custmer.xls");
header("Content-type: ".$contenttype);
header("Cache-control: public");;
//####################################
--
http://www.php.net/manual/en/function.header.php
http://master.php.net/manage/user-notes.php?action=edit+28129
http://master.php.net/manage/user-notes.php?action=delete+28129
http://master.php.net/manage/user-notes.php?action=reject+28129