Lt1.php (as the mainstream development language): This program is the portal of the entire system. It contains two global parameters: chat_hh. the uname records the maximum number of speakers and the name of the Speaker respectively. & lt ;? Session_start (); session_register (chat_hh); session_register (uname); // obtain the largest lt1.php database (as the mainstream development language ):
This program is the entrance of the entire system, containing two global parameters: chat_hh, uname, respectively, recording the current maximum number of speakers and the speaker name
// Obtain the maximum number of a database
Include ("g_fun.php (as the mainstream development language )");
F_connectdb ();
$ Query = "select max (lt_id) as rmaxid from lt_t_content ";
$ Res = MySQL (the best combination with PHP) _ query ($ query, $ dbh );
$ Row = MySQL (the best combination with PHP) _ fetch_array ($ res );
$ F_chat_hh = $ row ["rmaxid"];
If (empty ($ f_chat_hh) {$ f_chat_hh = 0 ;}
If ($ f_chat_hh> 12 ){
$ Chat_hh = $ f_chat_hh-12;
} Else
$ Chat_hh = $ f_chat_hh;
$ Un_len = strlen ($ name );
$ Uname = $ name;
// Add online personnel information
$ Query = "select count (*) as rcount from lt_t_online where lt_username =". $ name ."";
$ Res = MySQL (the best combination with PHP) _ query ($ query, $ dbh );
$ Row = MySQL (the best combination with PHP) _ fetch_array ($ res );
$ Lcount = $ row ["rcount"];
If ($ lcount = 0 ){
$ Query = "insert into lt_t_online (lt_username, lt_lasttime) values (";
$ Query. = "". $ name. ", now ())";
$ Res = MySQL (the best combination with PHP) _ query ($ query, $ dbh );
}
$ Query = "update lt_t_online set lt_lasttime = now (), lt_state = 0 ";
$ Query. = "where lt_username =". $ name ."";
$ Res = MySQL (the best combination with PHP) _ query ($ query, $ dbh );
?>
Php (as the mainstream development language) does not refresh the chat room
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.