FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


creating error pages





borrito
here are The error document

To create error pages under Apache you have to use .htaccess (or the extension you have set in httpd.conf).

Example on a 500 server error
PHP Code:
Code:
ErrorDocument 500 ./errors.php?id=500

Just use the same syntax on other types like 404, 403 ect.

The php file

As you can see in 'The error document' it redirects the user to './errors.php?id={TYPE}'. In this example i show you how you can code the error file.

Example
PHP Code:
Code:
  $errors = array(404 => 'Page not found',
            500 => 'Intern Server error');
    $c = 0;

    if(isset($_GET['id']))
    {
        while($c < count($errors))
        {
            if($_GET['id'] == $errors[$c])
            {
?>
   
Error [$c]; ?>

    You have blah blah...


                $c = (count($errors) + 1);
            }
        }
    }
    else
    {
?>
    Not valid error type ...
    }
?>
KHO
or, create a cool image and display it in a .shtml file, each file named for the number of the error Neutral
Related topics
Error 404 ..... How to Hide ...
Custom error pages using .htaccess
how can i have 2 sets of error pages
CUSTOM ERROR PAGES
Best Freeware
Custom Erro pages?
Rules to Make Your Site Annoying
Custom Error Pages
PHP Error Pages
Custom error pages problem
Creating secure pages?
General .htaccess tutorial.
Using PHP in error pages
Error pages
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.