3. Online User Information scanning and updating
Use a built-in framework in the web page to call scanning and updating Program This line can also be found on the webpage Source code See in!
<IFRAME name = flush src = "userflush. PHP "width =" 0 "Height =" 0 "frameborder =" 0 "scrolling =" no "marginwidth =" 0 "marginheight =" 0 "hspace =" 0 "vspace =" 0 "> </iframe>
4. Information scanning and updating program userflush. php
<?
Session_start ();
Mysql_connect ("localhost ","","");
Mysql_select_db ("php2000 ");
$ Delaytime = 0;
// Find a new speaker
$ Query = "select * From forumtalk where readsign = 0 and runner ER = '$ name '";
$ Result = mysql_query ($ query );
If (mysql_num_rows ($ result)> 0)
{
// Read and display dialog box
$ MSG = mysql_fetch_array ($ result );
$ Numberfriend = $ MSG ['id'];
Echo "<script language = JavaScript> window. Open ('shortalk. php? Action = view & talknumber = $ numberfriend ',' _ blank ', 'width = 300, Height = 100') </SCRIPT> ";
}
// Set the latest time mark of the current user, indicating that it is online
Mysql_query ("Update userinfo set currentdate =". date ("U"). "Where name = '$ name '");
// Set the refresh interval to 15 seconds.
Echo "<meta http-equiv = 'refresh' content = '15; url = userflush. php'> ";
?>