asp问题 在线等..................

shuicanyi 2003-10-15 09:40:47
小弟练习编写聊天室程序
但是错误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>
...全文
57 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
shuicanyi 2003-10-16
  • 打赏
  • 举报
回复
5555555555555555555555555555555555555
郁闷ING
tigerwen01 2003-10-15
  • 打赏
  • 举报
回复
头都看大了,建议您下载一个聊天室系统来用,不要自己写了。
aryou 2003-10-15
  • 打赏
  • 举报
回复
晕,,还是自己一点点调试进步的比较快,,,

:)
1蓝天1 2003-10-15
  • 打赏
  • 举报
回复
up
say1no2 2003-10-15
  • 打赏
  • 举报
回复
兄弟你贴了这么多代码别人怎么看啊,你可以把出错的地方贴出来看看!

用别人的程序,也是有好处的,程序看多了,自己的水平也会提高,特别是对刚学asp的新手来说!
shuicanyi 2003-10-15
  • 打赏
  • 举报
回复
我是学习ASP 总不会一辈子都下呀??

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧