欢迎光临
我们一直在努力

模拟oicq的实现思路和核心程序(二) _php实例

建站超值云服务器,限时71元/月

3 在线用户的信息扫描和更新
在网页中使用内置框架来调用扫描和更新程序,这行也能在网页源代码里面看到!
<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;

// 查找新的发言
$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>";
}

// 设置当前用户的最新时间标志,表示它在线
mysql_query("update userinfo set currentdate=".date("U")." where name=$name");

// 设置刷新时间间隔为15秒
echo "<meta http-equiv=refresh content=15;url=userflush.php>";
?> 

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » 模拟oicq的实现思路和核心程序(二) _php实例
分享到: 更多 (0)