If your user cannot find the page he wants, how can he give him a friendly reply, and you know this error has occurred? let's look at the following program, is used to customize the 404 error page and send notifications to the network management. --- Teaman translate? P if your user cannot find the page he wants, how can he give him a friendly reply and you know this error has occurred? look at the following program, is used to customize the 404 error page and send notifications to the network management. --- Teaman translation
# Set $ domain to your domain name (note that no www is available)
$ Domain = 'oso .com.cn ';
# Set the URL. Note that there is no trailing line/
$ Docroot = 'http: // www.oso.com.cn ';
# Set the font of the error message
$ Fontface = 'verdana ';
# Set the font size of the 404 page
$ Fontsize = '2 ';
# Set the background color of the 404 page. the default value is white.
$ Bgcolor = '# ffff ';
# Set text color. the default value is Xuan.
$ Textcolor = '#000000 ';
# Apply the $ reportlevel variable to determine whether to send emails to the network administrator.
#0 = do not send emails. Hey, how can teaman go wrong?
#1 = send a mail only when the page contains your DOMAIN NAME
#2 = send a message even if the connection is disconnected from me. it may be a friendship site.
$ Reportlevel = 2; // This is the safest
$ Emailaddress = 'webmaster @ oso.com.cn '; // sets the email address for receiving error messages.
Function print_details ()
{
# Request access to the global variables we need
Global $ fontface, $ fontsize, $ docroot, $ REQUEST_URI, $ reportlevel;
Global $ bgcolor, $ textcolor;
# Print the 404 error in web format
Echo' 404 no page found';
Echo'';
Echo'
404 Sorry, I did not find the page you requested';
Echo'
';
Echo 'Oss network administrator prompts you, the requested page $ docroot $ REQUEST_URI, doesn't exist ';
Echo 'on this server.
';
If ($ reportlevel! = 0)
{
Echo'
';
Echo 'The error message has been sent to the Osos network administrator .';
}
Return;
}
# EMAIL processing functions
Function send_email ()
{
# Request access to the global variables we need
Global $ REQUEST_URI, $ HTTP_REFERER, $ emailaddress, $ REMOTE_ADDR, $ docroot;
# Customize the sent message, such as the time and location.
$ Today = getdate ();
$ Month = $ today [mon];
$ Mday = $ today [mday];
$ Year = $ today [year];
$ Hours = $ today [hours];
$ Minutes = $ today [minutes];
$ Errortime = '$ month/$ mday/$ year at $ hours: $ minutes ';