5 聊天信息的发送、阅读和回复程序 – shortalk.php
<?
require(“require.php”); // 判断用户是否合法在线的公用程序
?>
<html>
<head>
<title>短信息</title>
<meta http-equiv=”content-type” content=”text/html; chart=gb2312″>
<style type=”text/css”>
td {font-size:9pt}
</style>
<script language=”javascript”>
<!–
function docheck() {
if (document.ndmsg.replymessage.value==””) {
alert(“缺少内容:需要输入您的留言内容”);
document.ndmsg.replymessage.focus();
return(fal);
}
return (true);
}
function mm_openbrwindow(theurl,winname,features) { //v2.0
window.open(theurl,winname,features);
}
//–>
</script>
</head>
<body bgcolor=”#ddddff”leftmargin=”0″ topmargin=”0″ background=”phpchat_images/cloudtile.jpg”>
<?
if($action == “view”)
{
$tmp = mysql_fetch_array(mysql_query(“lect nder,body,date from forumtalk where id=$talknumber and receiver=’$name'”));
$msg = $tmp[‘body’];
$message = ereg_replace(”
“,”\r\n”,$msg);
mysql_query(“update forumtalk t readsign=1 where id=$talknumber”);
$ndernickname = mysql_fetch_row(mysql_query(“lect nickname from urinfo where name='”.$tmp[‘nder’].”‘”));
?>
<table width=”300″ border=”0″ cellspacing=”0″ cellpadding=”0″ height=”200″ bgcolor=”f0f0f0″>
<tr>
<td colspan=”2″ height=”20″ bgcolor=”99cc99″ align=”center”>查看短信息</td>
</tr>
<tr>
<td colspan=”2″ height=”20″><?echo date(“m月d日 h:i”,$tmp[‘date’]).” “.$ndernickname[0]?> 给你[<?echo $name?>]留言:</td>
</tr>
<form name=viewtalk action=shortalk.php method=post>
<input type=hidden name=talkto value=<?echo $tmp[‘nder’]?>>
<input type=hidden name=action value=nd>
<input type=hidden name=talknumber value=<?print($talknumber)?>>
<tr align=”center”>
<td colspan=”2″ height=”146″ valign=”top”>
<textarea name=”textfield” cols=”40R高山流水遇知音43; rows=”11″ readonly><?print($message)?></textarea>
</td>
</tr>
<tr>
<td colspan=”2″ align=”center”>
<input type=”submit” name=”toreply” value=”回复留言 enter”>
<a href=”#” onclick=”mm_openbrwindow(‘memberviewtalk.php?talkto=<?echo $tmp[‘nder’]?>’,’viewtalk’,’scrollbars=yes’)”>聊天纪录</a> </td>
</tr>
</form>
</table>
<script language=”javascript”>
document.viewtalk.toreply.focus();
</script>
<?
}
el if ($action == “ndbegin”)
{
$replymessage = ereg_replace(“\r\n”,”
“,$replymessage);
$replymessage = ereg_replace(“>”,”>”,$replymessage);
$replymessage = ereg_replace(“<“,”<“,$replymessage);
$replymessage = substr($replymessage,0,2000);
mysql_query(“inrt into forumtalk (nder,receiver,body,date) values (‘$name’,’$talkto’,’$replymessage’,”.date(“u”).”)”);
print(“<script language=’javascript’>window.clo()</script>”);
}
el
{
?>
<table width=”300″ border=”0″ cellspacing=”0″ cellpadding=”0″ height=”200″ bgcolor=”f0f0f0″>
<form name=ndmsg action=shortalk.php method=post onsubmit=return(docheck());>
<input type=hidden name=action value=ndbegin>
<tr align=”center”>
<td colspan=”2″ height=”20″ bgcolor=”99cc99″>发送短信息</td>
</tr>
<tr align=”center”>
<td colspan=”2″ height=”20″>发言对象:
<lect name=”talkto”>
<?
$result = mysql_query(̶相遇是缘0;lect name,nickname from urinfo where onlinestatus=1”);
while($msg=mysql_fetch_array($result))
{
if($msg[‘name’]==$talkto)
echo “<option value='̶多特蒙德俱乐部1;.$msg[‘name’].”‘ lected>”.$msg[‘nickname’].”</option>\n”;
el
echo “<option value='”.$msg[‘name’].”‘>”.$msg[‘nickname’].”</option>\n”;
}
?>
</lect>
请短于500字符 </td>
</tr>
<tr align=”center”>
<td colspan=”2″ height=”146″ valign=”top”>
<textarea name=”replymessage” cols=”狼和羊的寓言故事40″ rows=”9″></textarea>
</td>
</tr>
<tr align=”center”>
<td colspan=”4″>
<?
if($talknumber != “”)
{
print(“<input type=button name=review value=’查看前一留言 alt+p’ accesskey=’p’ onclick=’javascript:history.go(-1)’>”);
}
?>
<input type=”submit” name=”reply” value=”开始新的发送留言 alt+s” accesskey=’s’&gppt自我介绍t;
<a href=”#” onclick=”mm_openbrwindow(‘memberviewtalk.php?talkto=<?echo $talkto?>’,’viewtalk’,’scrollbars=yes’)”>聊天纪录</a></td>
</tr>
</form>
</table>
<script language=”javascript”>
document.ndmsg.replymessage.focus();
</script>
<?
}
?>
</body>
</html>
本文发布于:2023-04-06 06:02:03,感谢您对本站的认可!
本文链接:https://www.wtabcd.cn/fanwen/zuowen/7371f5d677f9b93768cff2fda30ec840.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文word下载地址:模拟OICQ的实现思路和核心程序(三).doc
本文 PDF 下载地址:模拟OICQ的实现思路和核心程序(三).pdf
留言与评论(共有 0 条评论) |