asp问题 在线等..................
小弟练习编写聊天室程序
但是错误N 多
现在我把代码贴出来 需要各位大哥帮我看看???求求了
程序清单为
chat.asp main.asp showing.asp speaking.asp talker.asp
1。chat.asp 代码:-------------------------------------------------------------------
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<TITLE></TITLE>
</HEAD>
<BODY>
<%
uid=trim(request("uid"))
if len(uid)<>0 then
session("uid")=uid
%>
<div align="center"><br>
<br>
<br>
<br><a href="main.asp">
<b>进入聊天室.....</b>
<%
else
%>
</div>
<table width="267" border="1" cellspacing="0" cellpadding="0" align="center">
<tr>
<td>
<div align="center">欢迎你进入聊天室</div>
</td>
</tr>
<tr>
<td>
<form name="form1" method="post" action="chat.asp">
你的名字<input type="text" name="uid" maxlength="10" size="20">
<br>
你的密码<input type="password" name="pwd" maxlength="10" size="20">
<p align="center">
<input type="submit" name="Submit" value="提交">
</p>
</form>
</td>
</tr>
</table>
<P align="center"> </P>
</BODY>
</HTML>
<% end if
%>
2 。main.asp代码 ---------------------------------------------------------------------
<html>
<head>
<meta HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=gb2312">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>New Page 1</title>
</head>
<%
items=split(application("peoples"),",")
if ubound(items)=10 then
response.write "请你以后再近来,现在人已经满了! 对不起!"
session.abanon
response.end
end if
uid=session("uid")
application.lock
application("peples")=application("peoples")&uid&","
application(uid)="欢迎您进入聊天室!"
application.unlock
session("begin")=time
%>
<frameset rows="454,*">
<frameset cols="*,20%">
<frame name="header" scrolling="no" noresize target="main" src="showing.asp">
<frame name="header1" src="talker.asp" target="rtop">
</frameset>
<frame name="main" src="speaking.asp">
<noframes>
<body>
<p>此网页使用了框架,但您的浏览器不支持框架。</p>
</body>
</noframes>
</frameset>
</html>
speaking.asp 代码---------------------------------------------------------------
<html>
<%
'head>
%>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body bgcolor="rgb(200,200,200)">
<%
ext=request("ext")
if ext="退出" then
uid=session("uid")
items=split(appcation("peoples"),",")
application.lock
application("peoples")=" "
for i=0 to ubound(items)-1
if items(i)<>uid then
application("peoples")=application("peoples")&items(i)&","
end if
next
application(uid)=" "
application.unlock
session.abandon
response.end
else
if request("content")<>" " then
uid=session("uid")
strig="<font color='"&request("color")&"'>"&uid&request("content")& "</font><br>"
who=request("who")
items=split(application("peoples"),",")
application.lock
if request("who")="all" then
if request("who")="all" then
for i=0 to ubound(items)-1
application(items(i))=strig&application(items(i))
next
else
for i=0 to ubound(items)-1
if items(i)=uid or items(i)=who then
application(items(i))=strig&application(items(i))
end if
next
end if
application.unlock
end if
%>
字体颜色:<form name="form1" method="post" action="">
<p>
<select name="color">
<option value="blue">脸色</option>
</select>
<input type="text" name="content">
<input type="submit" name="ext" value="提交">
</p>
<p>表情:
<select name="facial">
<option value="gaoxins">gaoxin</option>
</select>
duixiang
<select name="who">
<option value="all">all</option>
<%
items=split(application("peoples"),",")
for i=0to ubound(items)-1
%>
<option value="<%=items(i)%> "><%=items(i)%></option>
<%next
end if %>
</select>
<input type="submit" name="ext" value="退出">
</p>
</form>
</body>
</html>
talker.asp代码-----------------------------------------------------------
<html>
<head>
<title>无标题文档</title>
<meta http-equiv="refresh" content="30; url=talker.asp"> <base target="rtop">
</head>
<body bgcolor="rgb(200,200,200)">
<%
if session("uid")<>" "then
%>
聊天者:<p>
<% items=split(application("peoles"),",")
for i=0 to ubound(items)
response.write "<font color=green>"&"-"&items(i)&"-"&"</font> <br>"
next
else %>
请你离开!
<%end if%>
</body>
</html>
showing.asp 代码 -----------------------------------------------------------------
<html>
<head>
<title>无标题文档</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<base target="ltop">
</head>
<body bgcolor="rgb(200,200,200)">
<%
uid=session("uid")
if session("ext")<>"退出" then
response.write application(uid)
else
%>
<p>
<center>请你离开聊天室</center>
<%end if
%>
</body>
</html>