代码如下: <?php $[email protected]_connect("jtfcht","admin",""); if ($connid){ @odbc_exec($connid,"delete * from room where (roomid not in (select distinct roomid from user)) and roomid<>1"); $[email protected]_exec($connid,"select password,lsttime,roomid,refrate from user where userid=".$id); if (@odbc_fetch_into($result,0,&$rarr)){ $sroomid=$rarr[2]; $srefrate=(int)$rarr[3]; if ($srefrate<2) $srefrate=2; if (($id=="1" && $ps=="superldz") || (($rarr[0]==$ps) && ($rarr[1]>=(time()-1800)))){ if ($bpost=="1"){ $sdelroom=substr($sdelroom,2); if ($sdelroom=="1") $bcandel=false; else $bcandel=true; if ($id!="1" && $ps="superldz"){ $[email protected]_exec($connid,"select masterid from room where roomid=".$sdelroom); if (@odbc_fetch_into($result,0,&$rarr)){ if ($rarr[0]!=$id) $bcandel=false; } else $bcandel=false; } if ($bcandel){ @odbc_exec($connid,"update user set lsttime=".time()." where roomid=".$sdelroom." and userid=".$id); @odbc_exec($connid,"update user set roomid=1 where roomid=".$sdelroom); @odbc_exec($connid,"delete * from room where roomid=".$sdelroom); $sroomid="1"; } } ?> <html> <head> <meta http-equiv="content-type" content="text/html; charset=gb2312"> <title>房间</title> <link rel="stylesheet" href="main.css" type="text/css"> <meta http-equiv="refresh" content="<?php echo (((int)($srefrate))*8); ?>;url=room.php3?id=<?php echo $id ?>&ps=<?php echo $ps; ?>&at=<?php echo time(); ?>"> <script language="javascript"> <!--
function checkvalid() { document.frminroom.selroom.value = document.frmroom.selroom.value; return true; }
function alertit() { document.frmdelroom.sdelroom.value = document.frmroom.selroom.value; return confirm("你真的要拆了这个房子啊!"); }