lt1.php(做為現在的主流開發語言):
該程序為整個系統的入口,含有兩個全局參數:chat_hh,uname分別記錄當前最大的發言序號和發言者名稱
<?
session_start();
session_register("chat_hh");
session_register("uname");
//取數據庫最大編號
include("g_fun.php(做為現在的主流開發語言)");
f_connectdb();
$query = "select max(lt_id) as rmaxid from lt_t_content";
$res = MySQL(和PHP搭配之最佳組合)_query($query, $dbh);
$row = MySQL(和PHP搭配之最佳組合)_fetch_array($res);
$f_chat_hh = $row["rmaxid"];
if (empty($f_chat_hh)) { $f_chat_hh = 0; }
if ($f_chat_hh > 12 ) {
$chat_hh=$f_chat_hh - 12;
} else
$chat_hh=$f_chat_hh;
$un_len=strlen($name);
$uname=$name;
//增加在線人員信息
$query = "select count(*) as rcount from lt_t_online where lt_username = ".$name."";
$res = MySQL(和PHP搭配之最佳組合)_query($query, $dbh);
$row = MySQL(和PHP搭配之最佳組合)_fetch_array($res);
$lcount = $row["rcount"];
if ($lcount == 0) {
$query = "insert into lt_t_online(lt_username,lt_lasttime) values(";
$query .= "".$name.",now())";
$res = MySQL(和PHP搭配之最佳組合)_query($query, $dbh);
}
$query = "update lt_t_online set lt_lasttime = now(),lt_state = 0 ";
$query .= " where lt_username = ".$name."";
$res = MySQL(和PHP搭配之最佳組合)_query($query, $dbh);
?>
<html>
<head>
<title>php(做為現在的主流開發語言)無刷新感聊天室</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script Language=JavaScript>
function wu(){
var un="<?echo $name;?>";
this.f2.document.fyq.username.value=un;
this.f2.document.fyq.username.size=<?echo $un_len;?>;
}
</script>
</head>
<frameset cols=*,140 border=1 frameborder=1 framespacing=>
<frameset rows="0,*,70,0" border="1" framespacing="0" frameborder="yes">
<frame src="about:blank" name="tforlt4">
<frame src="about:blank" name="f1" marginheight="3" marginwidth="5">
<frame src="ltsayno.php(做為現在的主流開發語言)" name="f2">
<frame src="about:blank" name="bforlt3">
</frameset>
<frameset rows=*,150 border=1 frameborder=1 framespacing=0>
<frame src=ltonline.php(做為現在的主流開發語言) name=f3 marginwidth=0 scrolling=auto>
<frame src="about:blank" name=f4 marginwidth=0>
</frameset>
</frameset>
<noframes>
<body bgcolor="#FFFFFF">
</body></noframes>
</html>
【本文版權歸作者與奧索網共同擁有,如需轉載,請注明作者及出處】