Hi All,
I am trying to sort out some custom error pages for my site and wondered if there was a way of adapting the .htaccess file used in plain HTML? Would I have to create a separate page for each error? Or if using a database, would I be able to create one error.php page, that would display the relevant information according to the error encountered?
Is there an alternative to .htaccess?
I have an .htaccess file like this
ErrorDocument 400 http://localhost/errors.php?errorType=400
ErrorDocument 401 http://localhost/errors.php?errorType=401
ErrorDocument 403 http://localhost/errors.php?errorType=403
ErrorDocument 404 http://localhost/errors.php?errorType=404
ErrorDocument 500 http://localhost/errors.php?errorType=500
ErrorDocument 501 http://localhost/errors.php?errorType=501
ErrorDocument 502 http://localhost/errors.php?errorType=502
ErrorDocument 503 http://localhost/errors.php?errorType=503
and this PHP in my error page document
<?php
$colname_rsErrors = "1";
if (isset($_POST['errorType'])) {
$colname_rsErrors = (get_magic_quotes_gpc()) ? $_POST['errorType'] : addslashes($_POST['errorType']);
}
mysql_select_db($database_ftc, $ftc);
$query_rsErrors = sprintf("SELECT * FROM ftc_errors WHERE errorType =%s", $colname_rsErrors);
$rsErrors = mysql_query($query_rsErrors, $ftc) or die(mysql_error());
$row_rsErrors = mysql_fetch_assoc($rsErrors);
$totalRows_rsErrors = mysql_num_rows($rsErrors);
?>
I am sure it can be done, but being rather new to PHP I am getting stumped!
Thanks
Phil
www.12csv.com