|
在網(wǎng)頁中使用內(nèi)置框架來調(diào)用掃描和更新程序,這行也能在網(wǎng)頁源代碼里面看到!
<iframe name=flush src="userflush.php" width="0" height="0" frameborder="0" scrolling="NO" marginwidth="0" marginheight="0" hspace="0" vspace="0"></iframe>
4 信息掃描和更新程序 userflush.php
<?
session_start();
mysql_connect("localhost","","");
mysql_select_db("php2000");
$delaytime=0;
// 查找新的發(fā)言
$query = "select * from forumtalk where readsign=0 and receiver='$name'";
$result = mysql_query($query);
if( mysql_num_rows($result) > 0)
{
// 讀取和顯示彈出窗口
$msg = mysql_fetch_array($result);
$numberfriend = $msg['id'];
echo "<script language=Javascript>window.open('shortalk.php?action=view&talknumber=$numberfriend','_blank','width=300,height=250')</script>";
}
// 設(shè)置當(dāng)前用戶的最新時間標(biāo)志,表示它在線
mysql_query("update userinfo set currentdate=".date("U")." where name='$name'");
// 設(shè)置刷新時間間隔為15秒
echo "<meta http-equiv='refresh' content='15;url=userflush.php'>";
?>
php技術(shù):模擬OICQ的實現(xiàn)思路和核心程序(二),轉(zhuǎn)載需保留來源!
鄭重聲明:本文版權(quán)歸原作者所有,轉(zhuǎn)載文章僅為傳播更多信息之目的,如作者信息標(biāo)記有誤,請第一時間聯(lián)系我們修改或刪除,多謝。