note 48822 added to function.session-cache-limiter

From: Date: Fri, 07 Jan 2005 20:04:25 +0000
Subject: note 48822 added to function.session-cache-limiter
Groups: php.notes 
Request: Send a blank email to php-notes+get-82928@lists.php.net to get a copy of this message
I have PHP 4.3 running on a Windows 2003 Server running IIS 6.0 also using SSL encryption for my pages. I could not (for the life of me) figure out how to get IE 6.0/WinXPPro to recognize a set of HTML tables as an Excel spreadsheet export, and it was due to the header() variables I was using. Hopefully these are helpful to others who are attempting the same type of export within PHP. *This example builds on the previously submitted one, adding a few necessary headers. <?php header("Expires: Sat, 01 Jan 2000 00:00:00 GMT"); header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); header("Pragma: public"); header("Expires: 0"); header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); header("Cache-Control: public"); header("Content-Description: File Transfer"); session_cache_limiter("must-revalidate"); header("Content-Type: application/vnd.ms-excel"); header('Content-Disposition: attachment; filename="fileToExport.xls"'); // and after you start the session session_start(); ?> ---- Manual Page -- http://www.php.net/manual/en/function.session-cache-limiter.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+48822 Delete -- http://master.php.net/manage/user-notes.php?action=delete+48822&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+48822&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+48822&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+48822&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+48822&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+48822&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+48822&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#82928) next »