note 76749 added to function.header
| From: | lasithadotalawattaatgmaildotcom at osu1 dot php dot net | Date: | Sun, 29 Jul 2007 05:15:53 +0000 |
| Subject: | note 76749 added to function.header | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-129017@lists.php.net to get a copy of this message | ||
Create MS-Excel file:
<?php
$export_file = "my_name.xls";
ob_end_clean();
ini_set('zlib.output_compression','Off');
header('Pragma: public');
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); // Date in the past
header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate'); // HTTP/1.1
header('Cache-Control: pre-check=0, post-check=0, max-age=0'); // HTTP/1.1
header ("Pragma: no-cache");
header("Expires: 0");
header('Content-Transfer-Encoding: none');
header('Content-Type: application/vnd.ms-excel;'); // This should work for IE &
Opera
header("Content-type: application/x-msexcel"); // This should work for the rest
header('Content-Disposition: attachment;
filename="'.basename($export_file).'"');
?>
----
Server IP: 69.147.83.197
Probable Submitter: 213.42.2.24 (proxied: 213.42.42.146)
----
Manual Page -- http://www.php.net/manual/en/function.header.php
Edit -- https://master.php.net/note/edit/76749
Del: integrated -- https://master.php.net/note/delete/76749/integrated
Del: useless -- https://master.php.net/note/delete/76749/useless
Del: bad code -- https://master.php.net/note/delete/76749/bad+code
Del: spam -- https://master.php.net/note/delete/76749/spam
Del: non-english -- https://master.php.net/note/delete/76749/non-english
Del: in docs -- https://master.php.net/note/delete/76749/in+docs
Del: other reasons-- https://master.php.net/note/delete/76749
Reject -- https://master.php.net/note/reject/76749
Search -- https://master.php.net/manage/user-notes.php