Lt1.php (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
<?
Session_start ();
Session_register ("chat_hh ");
Session_register ("uname ");
// 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 );
?>
<Html>
<Head>
<Title> php (as the mainstream development language): no refreshing Chat Room </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Script Language = JavaScript>
Function wu (){
Var un = "<? Echo $ name;?> ";
This.f2.doc ument. fyq. username. value = un;
This.f2.doc ument. fyq. username. size = <? Echo $ un_len;?>;
}
</Script>
</Head>
<Frameset cols = *, 140 border = 1 frameborder = 1 framespacing =>
<Frameset rows = "0, *, 70, 0" border = "1" framespacing = "0" frameborder = "yes">
<Frame src = "about: blank" name = "tforlt4">
<Frame src = "about: blank" name = "f1" marginheight = "3" marginwidth = "5">
<Frame src = "ltsayno. php (as the mainstream development language)" name = "f2">
<Frame src = "about: blank" name = "bforlt3">
</Frameset>
<Frameset rows = *, 150 border = 1 frameborder = 1 framespacing = 0>
<Frame src = ltonline. php (as the mainstream development language) name = f3 marginwidth = 0 scrolling = auto>
<Frame src = "about: blank" name = f4 marginwidth = 0>
</Frameset>
</Frameset>
<Noframes>
<Body bgcolor = "# FFFFFF">
</Body> </noframes>
</Html>
[This article is copyrighted by the author and osuo. If you need to reprint it, please indicate the author and its source]