六月婷婷综合激情-六月婷婷综合-六月婷婷在线观看-六月婷婷在线-亚洲黄色在线网站-亚洲黄色在线观看网站

明輝手游網(wǎng)中心:是一個免費提供流行視頻軟件教程、在線學習分享的學習平臺!

CGI圖文說明教程(11)出錯腳本

[摘要]錯誤腳本 額外的環(huán)境變量包括CGI 1.1 變量傳遞給錯誤腳本。這些CGI 1.1 變量有:REDIRECT_REQUEST :這是當正確發(fā)送給服務(wù)器的請求。REDIRECT_URL :這是導(dǎo)致錯誤的請求URL。REDIRECT_STATUS :這是如果NCSA HTTPd 已經(jīng)允許應(yīng)答的狀態(tài)數(shù)字...
錯誤腳本 額外的環(huán)境變量包括CGI 1.1 變量傳遞給錯誤腳本。這些CGI 1.1 變量有:

REDIRECT_REQUEST :這是當正確發(fā)送給服務(wù)器的請求。

REDIRECT_URL :這是導(dǎo)致錯誤的請求URL。

REDIRECT_STATUS :這是如果NCSA HTTPd 已經(jīng)允許應(yīng)答的狀態(tài)數(shù)字和信息。

另外,NCSA HTTPd在err_string=error_message時作為NCSA HTTPd產(chǎn)生的QUERY_STRING錯誤字符串傳遞。一些錯誤信息可以需要一些不在CGI規(guī)范中的文件頭�;谶@個原因,以下給出一個沒有解析的文件頭的腳本,它是用Perl編寫的:

#!/usr/local/bin/perl

# 這是一個利用Perl編寫的沒有解析文件頭的CGI 1.1錯誤腳本來處理錯誤請求。

$error = $ENV{'QUERY_STRING'};

$redirect_request = $ENV{'REDIRECT_REQUEST'};

($redirect_method,$request_url,$redirect_protocal) = split(' ',$redirect_request);

$redirect_status = $ENV{'REDIRECT_STATUS'};

if (!defined($redirect_status)) {

$redirect_status = "200 Ok";

}

($redirect_number,$redirect_message) = split(' ',$redirect_status);

$error =~ s/error=//;



$title = "<HEAD><TITLE>".$redirect_status."</TITLE></HEAD>";



if ($redirect_method eq "HEAD") {

$head_only = 1;

} else {

$head_only = 0;

}



printf("%s %s\r\n",$ENV{'SERVER_PROTOCOL'},$redirect_status);

printf("Server: %s\r\n",$ENV{'SERVER_SOFTWARE'});

printf("Content-type: text/html\r\n");



$redirect_status = "<img alt=\"\" src=http://edu.chinaz.com/images/icon.gif>".$redirect_status;

if ($redirect_number == 302) {

if ($error !~ /http:/) {

printf("xLocation: http://%s:%s%s\r\n",

$ENV{'SERVER_NAME'},

$ENV{'SERVER_PORT'},

$error);

if (!$head_only) {

printf("%s\r\n",$title);

printf("<H1>%s</H1>\r\n",$redirect_status);

printf("This document has moved");

printf("<A HREF=\"http://%s:%s%s\">here</A>.\r\n",

$ENV{'SERVER_NAME'},

$ENV{'SERVER_PORT'},

$error);

}

} else {

printf("Location: %s\r\n",$error);

if (!$head_only) {

printf("%s\r\n",$title);

printf("<H1>%s</H1>\r\n",$redirect_status);

printf("This document has moved");

printf("<A HREF=\"%s\">here</A>.\r\n",$error);

}

}

} elsif ($redirect_number == 400) {

printf("\r\n");

if (!$head_only) {

printf("%s\r\n",$title);

printf("<H1>%s</H1>\r\n",$redirect_status);

printf("Your client sent a request that this server didn't");

printf(" understand.<br><b>Reason:</b> %s\r\n",$error);

}

} elsif ($redirect_number == 401) {

printf("WWW-Authenticate: %s\r\n",$error);

printf("\r\n");

if (!$head_only) {

printf("%s\r\n",$title);

printf("<H1>%s</H1>\r\n",$redirect_status);

printf("Browser not authentication-capable or ");

printf("authentication failed.\r\n");

}

} elsif ($redirect_number == 403) {

printf("\r\n");

if (!$head_only) {

printf("%s\r\n",$title);

printf("<H1>%s</H1>\r\n",$redirect_status);

printf("Your client does not have permission to get");

printf("URL:%s from this server.\r\n",$ENV{'REDIRECT_URL'});

}

} elsif ($redirect_number == 404) {

printf("\r\n");

if (!$head_only) {

printf("%s\r\n",$title);

printf("<H1>%s</H1>\r\n",$redirect_status);

printf("The requested URL:<code>%s</code> ",

$ENV{'REDIRECT_URL'});

printf("was not found on this server.\r\n");

}

} elsif ($redirect_number == 500) {

printf("\r\n");

if (!$head_only) {

printf("%s\r\n",$title);

printf("<H1>%s</H1>\r\n",$redirect_status);

printf("The server encountered an internal error or ");

printf("misconfiguration and was unable to complete your ");

printf("request \"<code>%s</code>\"\r\n",$redirect_request);

}

} elsif ($redirect_number == 501) {

printf("\r\n");

if (!$head_only) {

printf("%s\r\n",$title);

printf("<H1>%s</H1>\r\n",$redirect_status);

printf("The server is unable to perform the method ");

printf("<b>%s</b> at this time.",$redirect_method);

}

} else {

printf("\r\n");

if (!$head_only) {

printf("%s\r\n",$title);

printf("<H1>%s</H1>\r\n",$redirect_status);

}

}



if (!$head_only) {

printf("<p>The following might be useful in determining the problem:");

printf("<pre>\r\n");

open(ENV,"env ");

while (<ENV>) {

printf("$_");

}

close(ENV);

printf("</pre>\r\n<hr>");

printf("<A HREF=\"http://%s:%s/\"><img alt=\"[Back to Top]\" src=\"/images/back.gif\"> Back to Root of Server</A>\r\n",

$ENV{'SERVER_NAME'},$ENV{'SERVER_PORT'});

printf("<hr><i><a href=\"mailto:webmaster\@%s\">webmaster\@%s</a></i> / ",

$ENV{'SERVER_NAME'},$ENV{'SERVER_NAME'});

printf("<i><a href=\"mailto:httpd\@ncsa.uiuc.edu\">httpd\@ncsa.uiuc.edu</a></i>");

printf("\r\n");




主站蜘蛛池模板: 视频精品一区二区 | 亚洲乱亚洲23p女 | 日韩一区二紧身裤 | 色噜噜在线观看 | 性高湖久久久久久久久aaaaa | 亚洲成a人片在线观看精品 亚洲成a人片在线观看导航 | 午夜久久久久久久 | 亚洲福利天堂 | 欧美性乱 | 青娱乐最新视频 | 天天躁日日躁成人字幕aⅴ 天天躁日日躁 疯人影院 | 色噜噜狠狠色综合日日 | 人人草网| 青娱乐在线免费观看视频 | 色综合色狠狠天天久久婷婷基地 | 亚洲欧美日韩精品久久 | 热の综合热の国产热の潮小说 | 亚洲第一免费网站 | 日日摸夜夜添夜夜添特色大片 | 香蕉app在线观看免费版 | 亚洲精品视频在线观看免费 | 五月婷婷六月香 | 日日夜夜网站 | 欧美一区二区三区四区五区六区 | 视频一区二区三区蜜桃麻豆 | 亚洲不卡| 亚洲爱视频| 亚洲好看站 | 欧美怡红院视频一区二区三区 | 日韩精品免费观看 | 日韩三级在线观看视频 | 中日韩视频在线看免费观看 | 中文字幕视频一区 | 四虎家庭影院 | 亚洲一区二区三区免费观看 | 日韩一级片免费在线观看 | 亚洲天堂精品在线观看 | 日韩 欧美 综合 在线 制服 | 四虎在线最新永久免费播放 | 亚洲网站免费看 | 日韩在线视频网 |