Sending server status codes...
Posted: Wed Jan 27, 2010 12:04 pm
Is it possible to send for example the 500 Internal Server Error status code to the client through PHP?
I have a few databases with some error handling when dealing with them:
This is somewhat the standard way of dealing with an error selecting a database. But I simply just want the server to send a 500 code the the client. If that database can't be selected there is no need for any of the page to be shown and there is no need for the user to know what went wrong just that something did. But I don't like the simple single line of text that the code above shows if an error occur. I find it much more accurate and well-known to show the 500 status page.
, MacGoose
I have a few databases with some error handling when dealing with them:
Code: Select all
mysql_select_db( "database" ) or die( "Unable to select database!" );, MacGoose