采用行写方式的聊天程序(之五)
2000-12-12 16:27:34 来源:WEB开发网核心提示:lt4.php 处理定时刷新问题 <? session_start(); include("g_fun.php"); f_connectdb(); $tmpi = 0; $query= "select lt_id,lt_speaker,lt_face,lt_speaked,lt_ti
lt4.php
处理定时刷新问题
<?
session_start();
include("g_fun.php");
f_connectdb();
$tmpi = 0;
$query = "select lt_id,lt_speaker,lt_face,lt_speaked,lt_time,lt_content from lt_t_content";
$query .= " where lt_id > ".$chat_hh. " order by lt_time ";
$res = MySQL_query($query, $dbh);
while ($row = mysql_fetch_array($res)) {
?>
<script Language=javaScript1.1>
var zt="<? echo '0'; ?>";
var un="<?echo $row['lt_speaker'];?>";
var tw="<?echo $row['lt_speaked'];?>";
var sa="<?echo $row['lt_content'];?>";
parent.f2.nw(zt,un,tw,sa); //向显示处写入最新的数据.
</script>
<?
$tempi=$row['lt_id'];
}
if ($tempi > $chat_hh) {
$chat_hh = $tempi;
}
?>
<script Language=Javascript>
setTimeout('this.location.reload()',5000);</script>
ltonline.php
处理在线用户信息
<?
include("g_fun.php");
f_connectdb();
//删除长时间没有发言的用户信息
$query = "update lt_t_online set lt_state = '1' where (now() - lt_lasttime) > 500";
$res = mysql_query($query, $dbh);
PRint " 在线人员信息<br>";
$query = "select lt_username from lt_t_online where lt_state = '0'";
$res = mysql_query($query, $dbh);
while ($row = mysql_fetch_array($res)) {
print $row["lt_username"].'<br>';
}
?>
<script Language=JavaScript>
setTimeout('this.location.reload()',5000);</script>
【本文版权归作者与奥索网共同拥有,如需转载,请注明作者及出处】
处理定时刷新问题
<?
session_start();
include("g_fun.php");
f_connectdb();
$tmpi = 0;
$query = "select lt_id,lt_speaker,lt_face,lt_speaked,lt_time,lt_content from lt_t_content";
$query .= " where lt_id > ".$chat_hh. " order by lt_time ";
$res = MySQL_query($query, $dbh);
while ($row = mysql_fetch_array($res)) {
?>
<script Language=javaScript1.1>
var zt="<? echo '0'; ?>";
var un="<?echo $row['lt_speaker'];?>";
var tw="<?echo $row['lt_speaked'];?>";
var sa="<?echo $row['lt_content'];?>";
parent.f2.nw(zt,un,tw,sa); //向显示处写入最新的数据.
</script>
<?
$tempi=$row['lt_id'];
}
if ($tempi > $chat_hh) {
$chat_hh = $tempi;
}
?>
<script Language=Javascript>
setTimeout('this.location.reload()',5000);</script>
ltonline.php
处理在线用户信息
<?
include("g_fun.php");
f_connectdb();
//删除长时间没有发言的用户信息
$query = "update lt_t_online set lt_state = '1' where (now() - lt_lasttime) > 500";
$res = mysql_query($query, $dbh);
PRint " 在线人员信息<br>";
$query = "select lt_username from lt_t_online where lt_state = '0'";
$res = mysql_query($query, $dbh);
while ($row = mysql_fetch_array($res)) {
print $row["lt_username"].'<br>';
}
?>
<script Language=JavaScript>
setTimeout('this.location.reload()',5000);</script>
【本文版权归作者与奥索网共同拥有,如需转载,请注明作者及出处】
- ››采用oracle中exp远程备份oracle
- ››采用 Rational Functional Tester 8.0 实现 Eclip...
- ››采用Symbian^3系统 诺基亚N8-00获证实
- ››聊天工具Miranda IM v0.8.19 发布了
- ››采用“独占”的方式给数据库设置密码
- ››聊天升级 有备MSN管家1.1版发布了
- ››采用DIV+CSS制作网站的优势
- ››采用Inventor的机械压机参数化设计及运动仿真
- ››采用碎片整理技术避免虚拟服务器性能下降
- ››采用C#反射机制和动态参数实现可插件业务平台
- ››聊天工具:Pidgin 2.5.1 发布
- ››聊天感受奥运氛围 飞信奥运特别版发布
更多精彩
赞助商链接