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

来源:asp之家 时间:2009-11-08 19:04:00 

chat.html 

<html> 
<head>
<title>asp之家-简单聊天</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.aspxhome.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 %>

标签:聊天程序,asp
0
投稿

猜你喜欢

  • em和strong的区别

    2008-12-23 12:08:00
  • MySQL 数值类型概述int smallint tinyint

    2010-11-02 11:46:00
  • asp如何建立和删除文件夹?

    2009-11-26 20:34:00
  • 在SQL Server中使用SQL语句查询一个存储过程被其它所有的存储过程引用的存储过程名

    2012-07-11 16:09:40
  • js字放大效果

    2010-09-07 12:18:00
  • jQuery 1.4官方中文手册[译]

    2010-01-20 10:46:00
  • asp+XMLHTTP的国际域名查询系统(whois)源代码

    2008-02-16 09:23:00
  • XML简易教程之三

    2008-09-05 17:19:00
  • 此数据库没有有效所有者,因此无法安装数据库关系图支持对象

    2012-01-29 18:15:11
  • SQL Server 2000里的数据类型

    2011-06-11 14:07:00
  • 自动清空站点目录下所有文件

    2009-06-24 11:11:00
  • 960 时代的终结

    2011-01-11 19:24:00
  • Web页脚设计的版权格式规范

    2009-07-22 20:52:00
  • asp产生不重复的随机数

    2008-06-03 13:29:00
  • 防盗链接ASP函数

    2011-03-07 11:02:00
  • 略谈美国雅虎首页改版

    2009-07-26 18:34:00
  • 如何检测用户第一次访问我的网站并显示友好信息?

    2009-11-25 20:33:00
  • 教你快速掌握数据库查询优化的实用技巧

    2008-11-28 15:10:00
  • ASP防盗链及防下载的方法

    2007-09-19 12:22:00
  • IE对CSS样式表的限制和解决方案

    2008-04-28 12:27:00
  • asp之家 网络编程 m.aspxhome.com