采用行寫方式的聊天程序(之四)

(接前面部分)

<body leftmargin=”0″ topmargin=”0″>
<p align=center>
<br>
<form method=”post” action=”lt3.php(做為現在的主流開發語言)” name=”fyq”  target=”bforlt3″ onsubmit=return(checksays());>

<input type=hidden name=oldsays value=>

姓名: <input type=”text” name=”username” maxlength=”10″ >

說:<input type=”text” name=”saystemp” maxlength=”200″ size=”50″ >

<input type=”submit” name=”send” value=”發言” >

<br>


<input type=checkbox name=towhoway value=1 onclick=”document.forms[0].saystemp.focus();”>
<a href=# onMouseOver=”window.status=選中本; return true”  
            onMouseOut=”window.status=;        return true” onClick=”document.forms[0].towhoway.checked=!(document.forms[0].towhoway.checked);   document.forms[0].saystemp.focus();” title=”悄悄話兒悄悄說”><font color=black>私聊</font></a>



<select name=towho style=font-size:12px onClick=dj()>
<option value=大傢 selected>大傢</select>

動作:<select name=addsign onchange=”rc(this.value);” style=font-size:12px>
     <option value=”0″ selected>—-</option>
     <option value=”//熱情地向在場的所有人打招呼。”>招呼</option>
    </select>

<input type=hidden name=”fontsize” size=3>
<input type=hidden name=”lineheight” size=3>
<input type=hidden name=”oldtitleline” value=”0″>

<input onclick=”javascript:cls();” type=”button” value=”清屏” style=”background-color:FFFFFF;color:000000;border: 1 double”>

<input access(小型網站之最愛)key=”a” type=”checkbox” name=”as” checked onclick=parent.f1.scrollit();document.fyq.saystemp.focus();>
<a href=”#” onclick=”Javascript:document.fyq.as.checked=!document.fyq.as.checked;
parent.f1.scrollit();
document.fyq.saystemp.focus();”>滾屏</a>  

</form>
<script>
parent.wu();
write();
document.fyq.saystemp.focus();
</script>
</body>
</html>

lt3.php(做為現在的主流開發語言)
處理發言信息

<?
session_start();
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);
$maxid =  $row[“rmaxid”];
if (empty($maxid)) { $maxid = 0; }
$maxid = $maxid + 1;
//增加聊天信息
$query  = “insert into lt_t_content(lt_id,lt_speaker,lt_speaked,lt_secrecy,lt_content,lt_time,lt_face)”;
$query .= ” values(“.$maxid.”,”.$username.”,”.$towho.”,1,”.$oldsays.”,now(),1)”;
$res = MySQL(和PHP搭配之最佳組合)_query($query, $dbh);  

//修改最後聊天時間,判斷用戶是否存在,防止超時被刪除
$query  = “select count(*) as rcount from lt_t_online where lt_username = “.$username.””;
$res = MySQL(和PHP搭配之最佳組合)_query($query, $dbh);  
$row = MySQL(和PHP搭配之最佳組合)_fetch_array($res);
$lcount =  $row[“rcount”];
if ($lcount == 0) {

發佈留言