Home >Backend Development >PHP Tutorial >用PHP和ACCESS写聊天室六_PHP教程
leave.php3 :
$ConnID=@odbc_connect("jtfcht","admin","");
if ($ConnID){
if (!($id=="1" && $ps="superldz")){
$result=@odbc_exec($ConnID,"SELECT UserName,PassWord,RoomID,Sex FROM User WHERE UserID=".$id);
if (@odbc_fetch_into($result,0,&$rArr)){
if ($rArr[1]==$ps)
if ($rArr[3])
@odbc_exec($ConnID,"INSERT INTO ChtCont (sIDFrom, sNameFrom, sIPFrom, sIDTo, sNameTo, sTime, sCont, bSecret, RoomID) VALUES (".$id.", ".$rArr[0].", ".getenv("REMOTE_ADDR").", 0, 大家, ".date("H:i:s").", 【系统消息】".$rArr[0]."离开了这个聊天室, False, ".$rArr[2].")");
else
@odbc_exec($ConnID,"INSERT INTO ChtCont (sIDFrom, sNameFrom, sIPFrom, sIDTo, sNameTo, sTime, sCont, bSecret, RoomID) VALUES (".$id.", ".$rArr[0].", ".getenv("REMOTE_ADDR").", 0, 大家, ".date("H:i:s").", 【系统消息】".$rArr[0]."离开了这个聊天室, False, ".$rArr[2].")");