如果您的用户找不到他要的页面,如何给他一个友好的答复,并且你也知道发生了这个错误呢,看看下面这段程序,是用来定制404错误页面和发通知给网管的好东西。---teaman翻译整理 # 设置 $domain 为你的域名 (注意没有www) $domain = "oso.com.cn"; # 设置URL,注意没有后划线 / $docroot = "http://www.oso.com.cn"; # 设置错误信息的字体 $fontface = "Verdana"; # 设置404页面的字体大小 $fontsize = "2"; # 设置404页面的背景颜色,缺省是白色 $bgcolor = "#ffffff"; # 设置文字颜色,缺省是黑色 $textcolor = "#000000"; # 使用 $reportlevel 变量来控制是否发信给网管 # 0 = 根本不用发信,嘿,teaman怎么会出错呢 # 1 = 只有在页面含有你的DOMAIN NAME时才发信 # 2 = 即使是与我连接出现的断连也发信,有可能是友情站点 $reportlevel = 2; //这种最保险了 $emailaddress = "webmaster@oso.com.cn"; //设置收错误信息的邮箱 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 " echo ""; echo " 404 对不起,我没有找到您要求的页面";echo " "; if ($reportlevel != 0) { echo " "; |
|小黑屋|最新主题|手机版|微赢网络技术论坛 ( 苏ICP备08020429号 )
GMT+8, 2024-9-29 23:40 , Processed in 0.139003 second(s), 12 queries , Gzip On, MemCache On.
Powered by Discuz! X3.5
© 2001-2023 Discuz! Team.