📄 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 + -