##### README file for error.php script ##### Author: Laura Melton This script is released under the GPL license. This basically means that you can use, modify, and distribute it, as long as you distribute the source code along with any binaries. (Not an issue with PHP. ) However, if you like my script, and especially if you use it, I would very much appreciate an email to say so. Please give me the URL of your site. Maybe I'll link to sites that are using my scripts. *** FILES I am distributing this script in both .zip and .tar.gz format, to accommodate both Windows and 'nix users. The .zip files use the Windows line break, and the .tar.gz use the 'nix one. This means that if 'nix users select the .zip file, they will have to remove those ugly ^M's at the end of each line, and if Windows users get the .tar.gz version, the whole PHP file will be on one line. The package consists of two files: error.php and this README. *** INSTALLATION Unpack the files. Open error.php and enter your email address for the $from and $to variables. Modify the messages that will be displayed to users, if you want. Upload error.php to the server, if it's not already there. Make sure it has the proper permissions. Modify your .htaccess file to use error.php for all the error codes you want it to use. Test. *** PHP The PHP code in this script uses neither registered globals nor short open tags. Therefore, there should be no compatibility problems. Functionally, the script returns a custom error page for various server error codes as 404 and 500 as well as some slightly less-common ones like 400, 401, 403, and 505. In the case of 404 and 500 errors ("not found" and "server error" respectively), it will email the webmaster (according to the configured address) to report the error. In addition, it reports the remote address of the viewer as well as the http referer (the page with the link s/he clicked on to get to the error-producing page). *** HTML I have left the HTML in this script intentionally plain, in order to allow users their own customization. As it stands, the script needs only a doctype declaration in order to validate as XHTML 1.0 strict; it should thus validate as any other doctype (except XHTML 2.0). This is one of my pet peeves; I hate modifying someone else's code to make a page validate. (I did not include a doctype because I don't want to impose mine on anyone else.) It's also annoying to make a script look the way I want, so I made it as simple to customize as I could. To customize the page's general look, modify any or all of the HTML around the tags. You probably need to know some PHP in order to do this. I'll probably help you if you need it. *** Have fun! ***