Is there a way to have a php script return a specific http status code rather than relying on apache to do it?
2 Answers
3 Comments
thomasrutter
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...
Wrikken
Actually.... You would check which HTTP version was requested of course, and respond in kind :P
iWantSimpleLife
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.