Re: Subject: please help from asp to php
| From: | Neil Smith | Date: | Mon, 07 Apr 2003 08:48:26 +0000 |
| Subject: | Re: Subject: please help from asp to php | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-19330@lists.php.net to get a copy of this message | ||
Hello - you can send standard HTTP headers from PHP using the header() function - here are some examples form the manual page :
"PHP scripts often generate dynamic content that must not be cached by the client browser or any proxy caches between the server and the client browser. Many proxies and clients can be forced to disable caching with "
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");
// always modified
header("Cache-Control: no-store, no-cache, must-revalidate");
// HTTP/1.1
header("Cache-Control: post-check=0, pre-check=0", false);
header("Pragma: no-cache");
// HTTP/1.0
So, you can see the use of the Expires header : just generate an appropriate date string (in the exact format above), and insert it into the headers.
About output buffering : See the manual about 'Output Control' I think its section "LXXII", but mainly you say :
ob_start();
// Start buffering the content from here
// Your PHP, outputting HTML (or plain HTML without PHP) goes here
ob_end_flush();
// End output and flush buffer to browser
Now where this gets interesting is you can put the name of a function as a callback for ob_start, which pre-processes the output before its flushed - for example a ZIP handler to gzip the output buffer, or something to do a search and replace on swearwords :-)
Cheers
NeiL Smith,
At 00:49 07/04/2003 +0000, you wrote:
Message-ID: <20030407004943.78375.qmail@pb1.pair.com> To: php-windows@lists.php.net From: "Ha Duy Thien" <thien@joins.com> Date: Mon, 7 Apr 2003 09:49:04 +0900 Subject: please help from asp to php MIME-Version: 1.0 Dear Php Gurus, I am converting ASP pages into Php pages and have two command in asp : Response.Buffer=true Response.Expires=0 Does anyone here know any command in php that is equivalent to above command, please show me Thanks you very much Thien