欢迎来到入门教程网!

编程问答

当前位置:主页 > 网络编程 > 编程问答 >

如何编写一个最简单的聊天程序?

来源:本站原创|时间:2020-01-11|栏目:编程问答|点击:

chat.html 
<html>
<head>

<title>精彩春风之简单聊天</title>

</head>
<frameset rows="*,100">
<frame src="chatopinions.asp">
<frame src="chatform.asp">
</frameset>
</html> 

chatopinions.asp
<html>
<head>
<META HTTP-EQUIV=refresh content="5;URL=chatopinions.asp"></head>
<body bgcolor=FFFFFF>
<center>
<table border=0 width=350>
<tr><td width=50>
<% =Application("A9") %></td><td width=300><% =Application("B9") %>
</td></tr><tr><td>
<% =Application("A8") %></td><td><% =Application("B8") %>
</td></tr><tr><td>
<% =Application("A7") %></td><td><% =Application("B7") %>
</td></tr><tr><td>
<% =Application("A6") %></td><td><% =Application("B6") %>
</td></tr><tr><td>
<% =Application("A5") %></td><td><% =Application("B5") %>
</td></tr><tr><td width=50>
<% =Application("A4") %></td><td><% =Application("B4") %>
</td></tr><tr><td>
<% =Application("A3") %></td><td><% =Application("B3") %>
</td></tr><tr><td>
<% =Application("A2") %></td><td><% =Application("B2") %>
</td></tr><tr><td>
<% =Application("A1") %></td><td><% =Application("B1") %>
</td></tr></table>
<table border=0 width=350>
<tr><td align=right>
Get your chat at <A REF="http://www.submitside.com">Submitside</A>: free script.
</td></tr></table>
</center>
</body></html> 

chatform.asp 
<% 
If Request.Form ("Opinion")="" then 
ShowForm() 
else 
  if Session("AA")="" then
  NewUser()
  GoAhead()
  else
  GoAhead()
  end if 
end if %>
<% Sub ShowForm() %>

<html><body  bgcolor=FFFFFF>
<center>
<form method=post action=chatform.asp>
<table border=0><tr><td>
<%  if Session("AA")="" then %>
选择名字或昵称
<input type=text name=Name size=20><BR>
输入您的看法 
<% else %>
<% =Session("AA") %>
<% end if %>
<input type=text size=60 name=Opinion value="<% =request.form("Opinion") %>"><BR>
<input type=submit value="
提交">
</td><tr></table>
</form>
</center>
</body></html>

<% End Sub %>

<% Sub GoAhead() %>

<%
BB=Request.form("Opinion")
BB=server.htmlencode(BB)

Application.Lock
Application("B1")=Application("B2")
Application("B2")=Application("B3")
Application("B3")=Application("B4")
Application("B4")=Application("B5")
Application("B5")=Application("B6")
Application("B6")=Application("B7")
Application("B7")=Application("B8")
Application("B8")=Application("B9")
Application("B9")=BB

Application("A1")=Application("A2")
Application("A2")=Application("A3")
Application("A3")=Application("A4")
Application("A4")=Application("A5")
Application("A5")=Application("A6")
Application("A6")=Application("A7")
Application("A7")=Application("A8")
Application("A8")=Application("A9")
Application("A9")=Session("AA")
Application.Unlock
%>

<html>
<head></head><body bgcolor=FFFFFF>
<center>
<form method=post action=chatform.asp>
<table border=0><tr><td>
<% =Session("AA") %> <input type=text size=60 name=Opinion>
<BR><input type=submit value="
提交">
</td></tr></table>
</form>
</center>
</body></html>

<% End Sub %>

<% Sub NewUser() %>
  <%
  AA=Request.form("Name")
  AA=server.htmlencode(AA)
  Session("AA")=AA
  %>

<% End Sub %>

 <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" />

[1]

上一篇:如何分页显示数据库查询结果?

栏    目:编程问答

下一篇:如何用表单的方式推送请求的信息?

本文标题:如何编写一个最简单的聊天程序?

本文地址:https://www.xiuzhanwang.com/a1/bianchengwenda/12060.html

网页制作CMS教程网络编程软件编程脚本语言数据库服务器

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:835971066 | 邮箱:835971066#qq.com(#换成@)

Copyright © 2002-2020 脚本教程网 版权所有