Is there a way to have a php script return a specific http status code rather than relying on apache to do it?
Boo you just beat me :P +1
GWW
2010-08-04 02:01:42
That's correct except I put HTTP/1.1 instead of 1.0. HTTP 1.0 is a dinosaur; it doesn't allow many features of the modern web. Granted, PHP would probably convert it to 1.1 anyway...
thomasrutter
2010-08-04 02:11:38
Actually.... You would check which HTTP version was requested of course, and respond in kind :P
Wrikken
2010-08-04 02:22:25
Usually I use this with a javascript auto refresh and the status code of 204 to tell the browser that there is no content. This way, the page will not refresh if there is nothing to update. (or refresh if there is a change)Only problem is on IE it will generate that horrible clicking sound every time the page is called.
iWantSimpleLife
2010-08-04 04:45:02
+1
A:
You can set header values manually with php, for example:
<?php
header("HTTP/1.0 404 Not Found");
?>
GWW
2010-08-04 02:01:25