Location: PHPKode > projects > logViewSQL > apache/http-status-codes.php
<?php
/* 
 * This is a php frontend for mod_log_sql. It interfaces
 * with the table structure as defined in a MySql database and has been
 * tested only with version 1.16 of mod_log_sql.
 *
 * contact hide@address.com
 *
 *
 *	$Id
 *	Simple function that returns the text equivelant of a http status
 *	code.	
 */
function getHttpCode($statusCode){
	switch ($statusCode){
		case 100:
		return "Continue";
		break;
		case 101:
		return "Switching Protocols";
		break;
		case 200:
		return "OK";
		break;
		case 201:
		return "Created";
		break;
		case 202:
		return "Accepted";
		break;
		case 203:
		return "Non-Authoritative Information";
		break;
		case 204:
		return "No Content";
		break;
		case 205:
		return "Reset Content";
		break;
		case 206:
		return "Partial Content";
		break;
		case 300:
		return "Multiple Choices";
		break;
		case 301:
		return "Moved Permanently";
		break;
		case 302:
		return "Moved Temporarily";
		break;
		case 303:
		return "See Other";
		break;
		case 304:
		/*
		   This indicates that the information or the link requested
		   has not changed since the last time the browser/client requested
		   that particular resource.
		   This is not really an error message.
		*/
		return "Not Modified";
		break;
		case 305:
		return "Use Proxy";
		break;
		case 400:
		return "Bad Request";
		break;
		case 401:
		return "Unauthorized";
		break;
		case 402:
		return "Payement Required";
		break;
		case 403:
		return "Forbidden";
		break;
		case 404:
		return "Not Found";
		break;
		case 405:
		return "Method Not Allowed";
		break;
		case 406:
		return "Not Acceptable";
		break;
		case 407:
		return "Proxy Authentication Required";
		break;
		case 408:
		return "Request Time Out";
		break;
		case 409:
		return "Conflict";
		break;
		case 410:
		return "Gone";
		break;
		case 411:
		return "Length Required";
		break;
		case 412:
		return "Precondition Failed";
		break;
		case 413:
		return "Request Entity Too Large";
		break;
		case 414:
		return "Request-URL Too Large";
		break;
		case 415:
		return "Unsupported Media Type";
		break;
		case 500:
		return "Server Error";
		break;
		case 501:
		return "Not Implemented";
		break;
		case 502:
		return "Bad Gateway";
		break;
		case 503:
		return "Out of Resources";
		break;
		case 504:
		return "Gateway Timeout";
		break;
		case 505:
		return "HTTP Version not supported";
		break;
		default:
		return "Unknown error code";
		break;
	}
}
?>
Return current item: logViewSQL