?? p412_error1.cgi
字號:
#!/usr/local/bin/sewse //Unix-alike OS users only
function show_html()
{
cgi.out("Content-Type: text/html \r \n");
cgi.out("\r \n");
cgi.out("<HTML>");
cgi.out("<BODY>");
\\ Uncomment one of the following two lines. Which depends on your OS
\\ Top line for UNIX, bottom line for Windows
\\ cgi.out("<FORM METHOD=\"POST\">");
\\ cgi.out("<FORM ACTION=\"http://myserver/cgi-bin/sewse.exe?error1.cgi\"
METHOD=\"POST\">");
cgi.out("Enter surname ...");
cgi.out("<INPUT TYPE=\"text\" NAME=\"surname\">");
cgi.out("<INPUT TYPE=\"submit\">");
cgi.out("</FORM>");
cgi.out("</BODY>");
cgi.out("</HTML>");
}
// Create global variable
var surname;
// called without submit
function main ()
{
if ( (surname = cgi.getVar("SURNAME"))== NULL || surname=="")
{
show_html();
}
else
{
if ( surname.toUpperCase() == "SMITH"
|| surname.toUpperCase() == "WONG"
|| surname.toUpperCase() == "SINGH"
|| surname.toUpperCase() == "BROWN" )
{
cgi.out("Content-Type: text/html \r \n");
cgi.out("\r \n");
cgi.out("<HTML>");
cgi.out("<BODY>");
cgi.out("Warning! Boring name alert!");
cgi.out("</BODY>");
cgi.out("</HTML>");
}
else
{
show_html();
}
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -