www.pudn.com > bbs3000afree.zip > bbs2.cgi
#!/usr/bin/perl
#------------------------------------------------------#
#¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡±¾³ÌÐòΪYuzi¹¤×÷ÊÒÌṩ¡¡ ¡¡¡¡¡¡¡¡¡¡#
#¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡YuziÂÛ̳3000(BBS3000)v4.00¡¡¡¡¡¡¡¡¡¡¡¡#
#------------------------------------------------------#
$cgipa="."; # CGI³ÌÐòÎļþµÄ¾ø¶Ô·¾¶
######################
## ÒÔϲ¿·Ö²»ÐèÐÞ¸Ä ##
######################
require "$cgipa/setup.cgi";
&GetCookies;
$cgiurl="bbs2.cgi";
##########
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;
$value=~s/\t/ /g;
$value=~s/>/>/g;
$value=~s/</g;
$value=~s/\n/\
/g;
$value=~s///g;
$FORM{$name} = $value;
}
##########
$id=$FORM{'id'};
$see=$FORM{'see'};
$emote=$FORM{'emote'};
$username=$FORM{'username'};
$userpsd=$FORM{'userpsd'};
$titles=$FORM{'titles'};
$comment=$FORM{'comment'};
$search=$FORM{'search'};
$menu=$FORM{'menu'};
$replytime=$FORM{'replytime'};
$retitles=$FORM{'retitles'};
$deltitle=$FORM{'deltitle'};
$rdcomment=$FORM{'rdcomment'};
if ($username eq ""){$username=$Cookies{username}};
if ($userpsd eq ""){$userpsd=$Cookies{password}};
$id=~s/\.\.//g;
$username=~s/\ //g;
$username=~s/\¡¡//g;
if($id=~m/[\#\&\*\=\+\\\:\"\/\<\>?'`ÿ]/){&errorview("IDÖв»Äܺ¬ÓÐÌØÊâ×Ö·û!");}
if($username=~m/[\#\&\*\=\+\\\:\"\/\<\>?'`ÿ]/){&errorview("Ãû×ÖÖв»Äܺ¬ÓÐÌØÊâ×Ö·û!");}
if($loginok eq "1" && $Cookies{username} eq ""){
print "Content-type: text/html\n\n";exit;
}
##########
if (-d "$filepath/list/$id"){
open (CHAT,"$filepath/list/$id.cgi");
$line=;
close(CHAT);
($bzmc,$secret,$bzrmail,$outurl,$bbsname,$fbzmc2,$rtime,$htmlt,$htmlw,$jj,$fbzmc)=split(/\t/,$line);
if ($Cookies{secret} ne $secret && $secret ne ""){print "Content-type: text/html\n\n";exit;}}else{&errorview("ϵͳ²»´æÔÚ´ËIDµÄÂÛ̳! ");}
if($username ne ""){
$yhzlurl ="$filepath/yhzl/$username.cgi";
if($regok eq "0"){unless(-f $yhzlurl){
open(PSD,">$yhzlurl");
print PSD $userpsd."\t".$username."\t\t\t".$lasttime;
close(PSD);
chmod(0666,$yhzlurl);}}
open(PSD,"$yhzlurl")||&errorview("¶Ô²»Æð£¬´ËÓû§Ãû»¹Ã»ÓÐ×¢²á!");
$liness=;
close(PSD);
($rdpassword,$rdname,$rdmail,$rdhome,$rlast,$rdqm,$rdsex,$rdwork,$rdcity,$rdlove,$rfy,$rhf,$tu,$jiao,$iewin,$QQ,$photo,$savecookie)=split(/\t/,$liness);
if($rdpassword ne $userpsd){&errorview("¶Ô²»Æð£¬ÄúµÄÃÜÂë´íÎó!");}}
if($bbsname eq ""){$bbsname="¹«¸æÀ¸";}
if($FORM{'page'}){$page=$FORM{'page'};}else{$page =0;}
if($menu eq "listtitle"){&listtitle;exit;}
elsif($menu eq "findtitle"){&findtitle;exit;}
elsif($menu eq "win"){&win;exit;}
elsif($menu eq "deltitle"){do "$cgipa/sub/deltitle.cgi";exit;}
elsif($menu eq "editform"){do "$cgipa/sub/editform.cgi";exit;}
elsif($menu eq ""){
print "Content-type: text/html\n\n";
print <
$bbsname