level 10
asp做的聊天室,输入昵称进入后,昵称显示,发送一句话后就不显示了,求解
2015年05月11日 14点05分
5
level 10
一共两个asp网页,聊天页的代码:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
name=request.form("userid")
Session("sname")=name
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>同城交友聊天室</title>
<style type="text/css">
<!--
.style1{font-size:36px;font-family:"华文隶书";}
.style2{
color:#0000FF;
font-weight: bold;
}
.online {
text-align: left;
font-size:18px;
color:#FF00FF;
}
-->
</style>
</head>
<body bgcolor="#FFE4E1">
<p align="center">
<br>
<span class="style1"><span class="style2">同城交友聊天室</span></span>
</p>
<span class="online">当前在线人数:<%= Application("online_number")%></span>
<hr />
<form method="post" name="form" action="chat.asp">
<p><div><font color="#0033CC" size="
+3
"><%=Session("sname")%>说:</font></div>
<input type="text" name="talk" size="50">
<input type="submit" name="formsubmit" value="发送">
<input type="reset" name="formreset" value="重发"></p>
</form>
<form method="post" name="backform" action="index.asp">
<input type="submit" name="back" value="退出">
</form>
<hr />
<form method="post" name="form1">
<pre>
<%
dim mytalk
If trim(Request.Form("talk"))="" Then
mytalk=Server.HTMLEncode(Session("sname"))&"不说一句话就想来敷衍大家"
Else
mytalk=trim(Request.Form("talk"))
application.Lock
Application("show")="<font color=#0000FF size=5>" & "<a title="&Request.ServerVariables("remote_addr")&">"&response.write(Session("sname"))&" "&time()& "说</font>:"&"<br>"&"<font size=5>" &mytalk& "</font>"&"<br>"&Application("show")
application.UnLock
response.Write application("show")
End If
%>
<br /></pre>
</form>
</body>
</html>
2015年05月11日 14点05分
6
level 10
index.asp的代码:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>同城交友聊天室</title>
<style type="text/css">
<!--
.style1{font-size:36px;font-family:"华文隶书";}
.style2{
color:#0000FF;
font-weight: bold;
}
.style3{color:#060;font-size:18px;}
.style4{font-size:24px;color:#990000;}
-->
</style>
</head>
<body bgcolor="#FFE4E1">
<p align="center">
<br>
<span class="style1"><span class="style2">同城交友聊天室</span></span>
</p>
<center>
<hr /></br>
<form method="post" name="myform" action="chat.asp">
<div align="center"><span class="style4">您的昵称是:</span> <input type="text" name="userid" size="19" maxlength="10" /><br/> </div>
<p>
<input type="submit" name="submit" class="style3" value="登录" />
<input type="reset" name="reset" class="style3" value="重置" />
</form>
</p>
</center>
<br />
<center>
<p class="style2">
<%set newobject=Server.CreateObject("MSWC.browsertype")%>
</p>
<p class="style2">
当前的浏览器是:<%=newobject.browser%></p>
<span class="style2">版本号是:<%=newobject.version%></span>
</center>
</body>
</html>
2015年05月11日 14点05分
7