Enterrm. php3
The Code is as follows:
<? Php
$ ConnID = @ odbc_connect ("jtfcht", "admin ","");
If ($ ConnID ){
$ Result = @ odbc_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 ($ rArr [0] === ps) & ($ rArr [1] >=( time ()-1800 ))){
$ SNewRoomID = substr ($ selRoom, 2 );
If ($ sNewRoomID! = $ SRoomID ){
$ Result = @ odbc_exec ($ ConnID, "SELECT Password FROM Room WHERE RoomID =". $ sNewRoomID );
If (@ odbc_fetch_into ($ result, 0, & $ rArr )){
If (strlen (trim ($ rArr [0]) = 0) | ($ rArr [0] = $ sPass )){
@ Odbc_exec ($ ConnID, "UPDATE User SET RoomID =". $ sNewRoomID. ", ToID = 0, ToName = 'Everybody 'WHERE UserID =". $ id );
If (int) $ sRoomID! = 1 ){
$ Result = @ odbc_exec ($ ConnID, "select count (UserID) FROM User WHERE RoomID =". $ sRoomID );
@ Odbc_fetch_into ($ result, 0, & $ rArr );
If ($ rArr [0] = 0) @ odbc_exec ($ ConnID, "DELETE * FROM Room Where RoomID =". $ sRoomID );
}
}
Else {
?>
<Html>
<Head>
<Title> enter the room password </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Link rel = "stylesheet" href = "main.css" type = "text/css">
<Script language = "JavaScript">
<! --
Function PassSetFocus (){
Document. frmEnterSm. sPass. focus ();
}
// -->
</Script>
<Link rel = "stylesheet" href = "main.css" type = "text/css">
</Head>
<Body onload = "PassSetFocus ();">
<P> </p>
<P align = "center"> <font color = "#996666"> enter the room password </font> </p>
<Form name = "frmEnterSm" action = "enterrm. php3" method = "post">
<Table width = "100%" border = "0" align = "center">
<Tr>
<Td colspan = "2"> <input type = "hidden" name = "selRoom" value = "<? Php echo $ selRoom;?> "> <Input type =" hidden "name =" id "value =" <? Php echo $ id;?> "> <Input type =" hidden "name =" ps "value =" <? Php echo $ ps;?> "> </Td>
</Tr>
<Tr>
<Td width = "40%" align = "right"> password: </td>
<Td width = "60%"> <input type = "password" name = "sPass" maxlength = "10" size = "8"> </td>
</Tr>
<Tr>
<Td colspan = "2" align = "center"> <input type = "submit" name = "cmdYes" value = ""> </td>
</Tr>
</Table>
</Form>
<P align = "center"> press <a href = "room. php3? Id = <? Php echo $ id;?> & Ps = <? Php echo $ ps;?> & At = <? Php echo time () ;?> "> Here </a> discard </p>
</Body>
</Html>
<? Php
Exit ();
}
}
Else {
?>
<Html>
<Head>
<Title> An error occurred while joining the room. </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Link rel = "stylesheet" href = "main.css" type = "text/css">
</Head>
<Body>
<P> </p>
<P align = "center"> the room has been split! </P>
<P align = "center"> press <a href = "room. php3? Id = <? Php echo $ id;?> & Ps = <? Php echo $ ps;?> & At = <? Php echo time () ;?> "> Here </a> return </p>
</Body>
</Html>
<? Php
Exit ();
}
}
}
Else echo "}
Else echo "@ Odbc_close ($ ConnID );
}
Else echo "Include ("room. php3 ");
?>
[This article is copyrighted by the author and osuo. If you need to reprint it, please indicate the author and its source]