?? cookie.cgi
字號:
#!/usr/bin/perl
#------------------------------------------------------#
# 本程序為Yuzi工作室提供 #
# Yuzi論壇3000(BBS3000)v4.00 #
#------------------------------------------------------#
$cgipa="."; # CGI程序文件的絕對路徑
######################
## 以下部分不需修改 ##
######################
require "$cgipa/setup.cgi";
&GetCookies;
if ($ENV{'REQUEST_METHOD'} eq "POST") {
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'});
}
else {
$buffer = $ENV{'QUERY_STRING'};
}
@pairs = split(/&/, $buffer);
foreach $pair (@pairs) {
($name, $value) = split(/=/, $pair);
$value=~tr/+/ /;
$value=~s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
$FORM{$name} = $value;
}
$menu=$FORM{'menu'};
if($menu eq "setup"){&setup;exit;}
elsif($menu eq "setuppage"){&setuppage;exit;}
elsif($menu eq "estate"){&estate;exit;}
elsif($menu eq "line"){&line;exit;}
elsif($menu eq "openline"){&openline;exit;}
sub openline{
if($FORM{'line'} eq ""){$openline="1"}
elsif($FORM{'line'} eq "1"){$openline=""}
print "Content-type: text/html\n\n";
print <<EOF;
<html><head><SCRIPT>
expireDate=new Date;
expireDate.setYear(expireDate.getYear()+1);
document.cookie="line="+"$openline"+";expires="+expireDate.toGMTString()+";";
document.location='$ENV{'HTTP_REFERER'}'
</SCRIPT></head>
</body></html>
EOF
exit;
}
sub line{
print "Content-type: text/html\n\n";
print <<EOF;
<html><head><SCRIPT>
document.cookie="estate="+"";
</SCRIPT></head><script>alert('您當前的狀態:在線');history.back();</script>
</body></html>
EOF
exit;
}
sub estate{
print "Content-type: text/html\n\n";
print <<EOF;
<html><head><SCRIPT>
expireDate=new Date;
expireDate.setYear(expireDate.getYear()+1);
document.cookie="estate="+"1"+";expires="+expireDate.toGMTString()+";";
</SCRIPT></head><script>alert('您當前的狀態:隱身');history.back();</script>
</body></html>
EOF
exit;
}
print "Content-type: text/html\n\n";
print <<EOF;
<html><head><SCRIPT>
document.cookie="username="+"";
document.cookie="password="+"";
document.cookie="estate="+"";
document.cookie="line="+"";
document.cookie="xuansave="+"";
</SCRIPT></head><script>alert('您的COOKIE已經成功被清除了!');history.back();window.close();</script>
EOF
exit;
sub setup{
if($FORM{'bgcolor'} eq "none"){$cookiebgcolor="";}
if($FORM{'bgcolor'} eq ""){$cookiebgcolor="_FFFFFF_007CD0_007CD0_F0F0F0_F8F8F8_0095F9";}
if($FORM{'bgcolor'} eq "1"){$cookiebgcolor="1_FFFFFF_AAB883_AAB883_F0F0F0_F8F8F8_D4D6BA";}
if($FORM{'bgcolor'} eq "2"){$cookiebgcolor="2_FFFFFF_ACABC4_ACABC4_F0F0F0_F8F8F8_DEE0E6";}
print "Content-type: text/html\n\n";
$savetime="expires=\"+expireDate.toGMTString()+\";";
print <<EOF;
<html><head><META http-equiv=Content-Type content=text/html; charset=gb2312><SCRIPT>
expireDate=new Date;
expireDate.setYear(expireDate.getYear()+1);
document.cookie="xuansave="+"$FORM{'xuansave'}"+";$savetime";
document.cookie="estate="+"$FORM{'estate'}"+";$savetime";
document.cookie="line="+"$FORM{'line'}"+";$savetime";
document.cookie="bgcolor="+"$cookiebgcolor"+";$savetime";
</SCRIPT></head><body><script>alert('您的參數已經設置成功!');history.back();</script><script language=javascript>window.close();</script>
EOF
exit;
}
sub setuppage{
if($Cookies{estate} eq ""){$estateselected=selected;}
if($Cookies{line} eq ""){$lineselected=selected;}
if($Cookies{xuansave} eq ""){$saveselected=selected;}
&css;
print <<EOF;
<TITLE>BBS3000-個性設置</TITLE><style>
input {font-size: 9pt;}
</style><BODY background=$imagurl/bg.gif><CENTER><TABLE width="90%" border=0><TBODY><tr><TD align=center><IMG src=$imagurl/bbtitle5.gif></TD></FONT><TD align=middle><b><font size=4 color=$bgcolor0>個性設置</font></b><BR><FONT size=1><ACRONYM title=編輯您的個人信息><a href="yhxiu.cgi"><IMG src="$imagurl/top_profile.gif" border=0></a></ACRONYM> <ACRONYM title=免費注冊為新會員><a href="yhreg.cgi"><IMG src="$imagurl/top_register.gif" border=0></a></ACRONYM> <ACRONYM title=設置您的參數><IMG src="$imagurl/top_preferences.gif" border=0></ACRONYM> <ACRONYM title=搜索各論壇帖子的內容><a href="search.cgi"><IMG src="$imagurl/search.gif" border=0></a></ACRONYM> <A href="$imagurl/help.htm"><ACRONYM title="常見問題解答"><IMG src="$imagurl/top_faq.gif" border=0></ACRONYM></A>
</TD></TR></TBODY></TABLE><table border=0 cellpadding=0 cellspacing=10 width=653 align=center>
<tr><td colspan=2 width="647"><FONT style=font-size:9pt color="#000000"><p>本論壇使用COOKIE來儲存您的設置。有時您瀏覽器中的COOKIE會變得混亂或被刪除。如果這樣,您也許希望刪除所有在本論壇生成的COOKIE,但這也意味著所有保存的COOKIE信息將丟失,當然,和COOKIE有關的問題也將隨之解決 <a HREF="cookie.cgi">點擊這里清除所有
COOKIE</a></p></font></td></tr></table><center><FORM NAME="PREFS" METHOD=POST><table border=0 cellpadding=0 cellspacing=0 width="378"><TR><td bgcolor="#000000" width="602">
<table border=0 cellpadding=4 cellspacing=1 width=492><tr><TD colspan=2 width="478" bgcolor="#FFFFFF" align="center"><FONT style=font-size:9pt >
<b>您可以按您的習慣設置論壇,目前有四個選項可供設置</b></FONT></td></tr>
<tr bgcolor=$bgcolor2><TD width="214" align="right"><FONT style=font-size:9pt >隱身登陸:</FONT></TD>
<TD width="252">
<select name=estate><option value=1>是</option><option value='' $estateselected>否</option></select>
</TD></tr>
<TR bgcolor=$bgcolor1><TD width="214" align="right">密碼保存在緩存里:</FONT></TD>
<TD width="252">
<select name=xuansave><option value=1>是</option><option value='' $saveselected>否</option></select>
</TD></tr>
<TR bgcolor=$bgcolor2><TD width="214" align="right">在線人員列表:</FONT></TD>
<TD width="252">
<select name=line><option value=1>打開</option><option value='' $lineselected>關閉</option></select>
</TD></tr>
<TR bgcolor=$bgcolor1><TD width="214" align="right">色彩方案:</FONT></TD>
<TD width="252">
<select name=bgcolor>
<option value='none'>默認</option>
<option value=''>藍色</option>
<option value='1'>橄欖綠</option>
<option value='2'>銀色</option>
</select>
</TD></tr>
</TABLE></td></tr></table></center><BR><BR><CENTER><INPUT TYPE="HIDDEN" NAME="menu" VALUE="setup">
<INPUT TYPE="SUBMIT" NAME="Submit" VALUE="確定"> <INPUT TYPE="RESET" NAME="Reset" VALUE="重來"></FORM></body></html>
EOF
exit;
}
######################### END OF SCRIPT #########################
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -