Sandisksecureaccess: sandisksecureaccess use PHP and ACCESS to write the chat room 7: chtcont. php3: the code is as follows: & lt ;? Php $ SC $ Cif ($ ConnID) {if ($1 & $ pssuperldz) {$ result @ odbc_exec ($ ConnID, SELECTTOP25sTim chtcont. php3:
The code is as follows:
$ SC
$ C
If ($ ConnID ){
If ($ id = "1" & $ ps = "superldz "){
$ Result = @ odbc_exec ($ ConnID, "select top 25 sTime, sCont, sNameFrom, sNameTo, SeqID, sIPFrom FROM ChtCont order by SeqID DESC ");
$ LMax =-1;
While (@ odbc_fetch_into ($ result, 0, & $ rArr )){
$ SLine = $ rArr [0]. "". $ rArr [1];
$ SLine = str_replace ("% m", $ rArr [2]. "[". $ rArr [5]. "]", $ sLine );
$ SLine = str_replace ("% g", $ rArr [3], $ sLine );
$ SLine. ="
N ";
If ($ rArr [4]> $ lMax) $ lMax = $ rArr [4];
$ SC
}
If ($ lMax>-1) @ odbc_exec ($ ConnID, "UPDATE User SET FirstTime = False, LastLoc = ". ($ lMax + 1 ). "WHERE UserID = ". $ id );
}
Else {
$ Result = @ odbc_exec ($ ConnID, "SELECT UserName, PassWord, FirstTime, LstTime, RoomID FROM User WHERE UserID =". $ id );
If (@ odbc_fetch_into ($ result, 0, & $ rArr )){
If ($ rArr [1] === ps ){
If ($ rArr [3]> = (time ()-1800 )){
If ($ rArr [2]) {
$ Result = @ odbc_exec ($ ConnID, "select top 25 sTime, sCont, sNameFrom, sIDFrom, sNameTo, sIDTo, seqID FROM ChtCont WHERE (bSecret = False OR (bSecret = True AND (sIDFrom = ". $ id. "OR sIDTo = ". $ id. "OR sIDTo = 0) AND (RoomID = ". $ rArr [4]. "OR RoomID = 0) order by SeqID DESC ");
$ LMax =-1;
While (@ odbc_fetch_into ($ result, 0, & $ rArr )){
$ SLine = $ rArr [0]. "". $ rArr [1];
If ($ id = $ rArr [3])
$ SLine = str_replace ("% m", "you", $ sLine );
Else
$ SLine = str_replace ("% m", $ rArr [2], $ sLine );
If ($ id = $ rArr [5])
$ SLine = str_replace ("% g", "you", $ sLine );
Else
$ SLine = str_replace ("% g", $ rArr [4], $ sLine );
$ SLine. ="
N ";
If ($ rArr [6]> $ lMax) $ lMax = $ rArr [6];
$ SC
}
If ($ lMax>-1) @ odbc_exec ($ ConnID, "UPDATE User SET FirstTime = False, LastLoc = ". ($ lMax + 1 ). "WHERE UserID = ". $ id );
}
}
Else $ SC align = 'center'> You have timed out.
Click here to log on again
";
}
Else $ SC align = 'center'> The password is incorrect!
Click here to log on again
";
}
Else $ SC align = 'center'> This user does not exist!
Click here to log on again
";
}
@ Odbc_close ($ ConnID );
}
Else $ SC align = 'center'> failed to log on because of a system failure!
";
?>
Chat content
[This article is copyrighted by the author and osuo. if you need to reprint it, please indicate the author and its source]
The above introduces sandisksecureaccess using PHP and ACCESS to write chat room 7, including the sandisksecureaccess content, hope to be helpful to friends interested in PHP tutorials.