⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 login.cgi

📁 这个是分屏聊天室源码。需要分屏的聊天室请参考
💻 CGI
字号:
#!/usr/bin/perl

#$path = ".";  #这是unix下的配置
$path = &deenpath; #这是win nt iis下的所用的配置              k666软件园 http://www.vv66.net
# 打开配置文件与公用模块
do  "$path/config.cgi";
do  "$path/public.cgi";

&get_form;
&set_var;

if ($job eq "" ) { do "$path/loghtml.cgi" ; &login_html; } #第一种登录页面
if ($job eq "page2" ) { do "$path/loghtml.cgi" ; &login_html2; } #第二种登录页面
elsif ($job eq "chatgg") { do "$path/chatgg.cgi";	&chat_gg; }
elsif ($job eq "disp_line") { do "$path/write_online.cgi" ; do "$path/logline.cgi" ; &disp_line; }
elsif ($job eq "online") { do "$path/write_online.cgi" ; do "$path/logline.cgi" ; &disp_line2; }
elsif ($job eq "login") {
   &checkempty($username,"没有用户名");   #检查用户名是否为空
   &checkempty($usersex ,"没有用户性别")  if ($usersexmust==1);   # 检查用户性别是否为空
   if (length($username) > 10) {&error("用户名不能超过10个字符");}
   do "$path/logpass.cgi" ;   &chpass;	#检查用户密码
   &checkbekill();                      #检查用户是否是被踢出去的人
   $exist     =    "no" ;
   do "$path/write_online.cgi";
   &write_online("line");
   &write_online("online");
   &write_online("kill","$username","$chktype") if ($chktype eq "2");
   do "$path/write_message.cgi" ;
   &write_message("login")  if ($exist eq "no"); 
   do "$path/build.cgi" ;
   &return_whole; }
elsif ($job eq "logout") {
   $linefile = "$linehead$username";
	&error("您已经脱机,请重新登录") if (not -e $linefile );
    &checkbekill(); 
   &check_password;   #检查用户密码是否正确
   do "$path/logout.cgi" ;
   $tem_userout = "";                   #初始化退出提示
   &write_exec  if ( $chkpass == 3 );  #将用户的经验值写入
   $exist     ="no";
   do "$path/write_online.cgi";
   &write_online("outline"); 
   do "$path/write_message.cgi" ;
   &write_message("logout") if ($exist ne "no"); 
   &return_logout; }
elsif ($job eq "savepoint") {
   $linefile = "$linehead$username";
	&error("您已经脱机,请重新登录") if (not -e $linefile );
	&checkbekill(); 
   &check_password;   #检查用户密码是否正确
    do "$path/logout.cgi" ;
   &write_exec  if ( $chkpass == 3 ) ;  #将用户的经验值写入
   &success("你当前的经验 <font color=9933CC>$tem_exec</font>"); }
elsif ($job eq "settype") {
   $linefile = "$linehead$username";
	&error("您已经脱机,请重新登录") if (not -e $linefile );
   &check_password;
   do "$path/build.cgi";
   &return_type; }
elsif ($job eq "setfunc") {
   $linefile = "$linehead$username";
   &error("您已经脱机,请重新登录") if (not -e $linefile );
   &check_password;
   do "$path/build.cgi" ;
   &return_func; }
elsif ($job eq "setfresh") {
   &check_password;
   do "$path/build.cgi" ;
   &setfresh; }
elsif ($job eq "div") { #分屏与合屏
   &check_password;
   $sflag = &get_var('sflag'   ,'\n|‖');
   do "$path/write_online.cgi";
   &write_online("div"); 
   print "<html><head></head><body></body></html>\n"; }
exit;
#############################################
#检查用户是否是被踢出去的人
#############################################
sub checkbekill {
@bekill=&readtxtfile($killfile,2);
$chkbekill = 0;
$chktype   = 0;
$temuserip = &getip($userip);
foreach (@bekill) {
		($mark,$bekill_host,$bekill_name,$bekill_level,$bekill_sex,$bekill_type,$bekill_ip,$kill_time,$killer,$markend)=split(/‖/,$_);
		$killid = 0;
		if (($mark eq "killdata") && ($markend eq "end")) {
			if (($bekill_ip == 1)&&($bekill_name eq $username)) { $killid = 1; } #指定的用户
			if (($bekill_ip == 2)&&($bekill_host eq $userip)) { $killid = 1; }     #指定的IP
			if ($bekill_ip == 3) {												 #IP的前两位
				$killtemuserip = &getip($bekill_host);
				$killid = 1 if ($temuserip eq $killtemuserip); 	}
			if ($killid == 1 ) {
				if ( ($secn - $kill_time - $kick_out_time * 60 ) < 0 ) {
						$chkbekill = 1;
						$chktype   = $bekill_type;
						last; }
			}

		}
}
if ( $chkbekill== 1 ) {  do "$path/bekill.cgi";  &kill_htm($chktype); }  #如果被踢
}
sub deenpath  {
	local $filename,$mypath;
	$filename=__FILE__;
	if ($filename=~/\\/) { $filename=~ s/\\/\//g;}
	if ($filename) { $mypath=substr($filename,0,rindex($filename,"/"));  }
	else { $mypath=substr($ENV{'PATH_TRANSLATED'},0,rindex($ENV{'PATH_TRANSLATED'},"\\")); $mypath=~ s/\\/\//g; }
	return $mypath; }
sub getip  { #取前两组IP数字
	local $temip,$returnip,$position1,$position2;
	$temip = $_[0];
	$position1 = index ($temip, ".");
	$returnip = substr ($temip, 0, $position1);
	$position2 = index ($temip, ".",$position1);
	$returnip .= substr ($temip, $position1,$position2);
	return $returnip; }

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -