3. Online User Information scanning and updating
Use the built-in framework in the webpage to call scanning and updating programs. This line can also be seen in the webpage source code!
<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'> ";
?>