人人做人人澡人人爽欧美,国产主播一区二区,久久久精品五月天,羞羞视频在线观看免费

當(dāng)前位置:蘿卜系統(tǒng)下載站 > 技術(shù)開(kāi)發(fā)教程 > 詳細(xì)頁(yè)面

CGI圖文詳細(xì)教程(11)出錯(cuò)腳本

CGI圖文詳細(xì)教程(11)出錯(cuò)腳本

更新時(shí)間:2022-08-25 文章作者:未知 信息來(lái)源:網(wǎng)絡(luò) 閱讀次數(shù):

錯(cuò)誤腳本 額外的環(huán)境變量包括CGI 1.1 變量傳遞給錯(cuò)誤腳本。這些CGI 1.1 變量有:

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

REDIRECT_URL :這是導(dǎo)致錯(cuò)誤的請(qǐng)求URL。

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

另外,NCSA HTTPd在err_string=error_message時(shí)作為NCSA HTTPd產(chǎn)生的QUERY_STRING錯(cuò)誤字符串傳遞。一些錯(cuò)誤信息可以需要一些不在CGI規(guī)范中的文件頭。基于這個(gè)原因,以下給出一個(gè)沒(méi)有解析的文件頭的腳本,它是用Perl編寫(xiě)的:

#!/usr/local/bin/perl

# 這是一個(gè)利用Perl編寫(xiě)的沒(méi)有解析文件頭的CGI 1.1錯(cuò)誤腳本來(lái)處理錯(cuò)誤請(qǐng)求。

$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");

溫馨提示:喜歡本站的話(huà),請(qǐng)收藏一下本站!

本類(lèi)教程下載

系統(tǒng)下載排行

網(wǎng)站地圖xml | 網(wǎng)站地圖html
主站蜘蛛池模板: 连山| 乐亭县| 蓬安县| 霞浦县| 藁城市| 嘉祥县| 大英县| 泰和县| 凤阳县| 宝坻区| 油尖旺区| 织金县| 宝清县| 扎赉特旗| 米易县| 瓮安县| 曲周县| 沅陵县| 墨玉县| 红桥区| 清远市| 鹤壁市| 错那县| 广元市| 黄浦区| 通道| 和林格尔县| 鄂尔多斯市| 景洪市| 贵溪市| 巢湖市| 白沙| 石屏县| 石狮市| 重庆市| 中超| 高邮市| 鄂托克前旗| 达州市| 张掖市| 屏边|