online_check.inc.php
资源名称:Nsix.rar [点击查看]
上传用户:m68239277
上传日期:2014-10-12
资源大小:824k
文件大小:1k
源码类别:
Web服务器
开发平台:
PHP
- <?php
- $names=$_SESSION["name"];
- $sql_count=mysql_query("select * from online ",$conn);
- $nowtimes=date("Y-m-d H:i:s");
- $h=date("YmdHis");
- while($rowct=mysql_fetch_array($sql_count))
- {
- $tcid=$rowct["ID"];
- $tctimes=$rowct["active_time"];
- $tctime=split(" ",$tctimes);
- $tcymd=split("-",$tctime[0]);
- $tchms=split(":",$tctime[1]);
- $tclimit_times=mktime($tchms[0],$tchms[1],$tchms[2],$tcymd[1],$tcymd[2],$tcymd[0]);
- $lowtime=time()-$tclimit_times."<br>";
- if($lowtime>1800) mysql_query("delete from online where ID='$tcid'",$conn);
- }
- $sqlhv=mysql_query("select * from online where user_account='$user'",$conn);
- $find_haves=mysql_num_rows($sqlhv);
- $ip=$_SERVER['REMOTE_ADDR'];
- if($find_haves==0) mysql_query("insert into online(user_type,user_name,user_account,ip,login_time,active_time)values('1','$names','$user','$ip','$h','$h')",$conn);
- $sqlps=mysql_query("select * from member where user_account='$user'",$conn);
- mysql_query("update online set active_time='$nowtimes' where user_account='$user'",$conn);
- if(mysql_result($sqlps,0,"online")==1)
- {
- echo "<script language='javascript'>alert('对不起,您已被管理员请出网站!');window.location.href='exit.php';</script>";
- }
- ?>