超级菜鸟学ASP的一个超级问题

huangsizhong214 2005-09-09 09:32:07
我用asp编了一个留言板,填写表单中 “留言内容”和“留言者姓名”后 在上面显示留言内容
每当页面上有10个留言时,刷新页面(清空),然后再填写显示。
有两个文件AspChat1.asp和Global.asa

AspChat1.asp文件代码如下:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<style type="text/css">
<!--
body {
background-color: #0099CC;
}
.tit {
font-family: "隶书";
font-size: 36px;
color: #336666;
text-align: center;
}
.frm {
font-family: "宋体";
font-size: 18px;
color: #000000;
text-align: center;
}
-->
</style></head>

<body class="tit">
<p>网上留言板</p>


<hr align="center" size="1" noshade>
<% If request.ServerVariables("REQUEST_METHOD")="post" Then
if len(request("txtWho"))>0 then
session("ssWho")=request.Form("txtWho")
end if
application.Lock()
mlCounter=Application("giCounter")
maChats=Application("gaChats")
if mlCounter>9 then
mlCounter=0
end if
maChats(mlCounter)= session("ssWho")&":"& request.form("txtCents")
'Response.Write (maChats(mlCounter))& "<br>"①
mlCounter=mlCounter+1
application("giCounter")=mlCounter
Application("gaChats")=maChats
Application.UnLock()
End If

%>
<%
Response.Write Application("gaChats")(mlCounter)②
%>
<hr size="1" noshade>


<form action="AspChat1.asp" method="post" name="frmasp" id="frmasp">
<table width="94%" border="1" cellspacing="0" cellpadding="0" bordercolor="#336699">
<tr align="center" bgcolor="#FFFFCC">
<td width="22%" class="frm">留言内容</td>
<td width="78%"> 
<textarea name="txtCents" cols="50" id="txtCents"></textarea></td>
</tr>
<tr bgcolor="#CCFF99">
<td align="center" class="frm">留言者姓名</td>
<td> 
<input name="txtWho" type="text" id="txtWho" size="40"> </td>
</tr>
<tr bgcolor="#FFFFCC">
<td height="28" colspan="2" align="center" class="frm"><input type="submit" name="Submit" value="提交留言信息"></td>
</tr>
</table>
</form>

</body>
</html>



Global.asa文件内容如下:

<Script language="VBScript" runat="server">
Sub Application_OnStart
Dim maChats(15)
Application("gaChats")=maChats '保存留言内容
Application("giCounter")=0 '保存留言数目
End Sub
</Script>


当AspChat1.asp文件中 ①语句 注释掉,保留 ②语句 时页面出错 提示:
类型不匹配: 'application(...)'/web/leaveword/AspChat1.asp, 第 69 行 即 Response.Write Application("gaChats")(mlCounter)

当AspChat1.asp文件中 ②语句 注释掉,保留 ①语句 时,表单的上面不会显示留言内容。

请各位高手指点迷津!!!!
...全文
143 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
dbserver 2005-09-14
  • 打赏
  • 举报
回复
顶吧

---------------
欢迊来到麦高网-私活兼职首选平台 www.mgao.net
huangsizhong214 2005-09-14
  • 打赏
  • 举报
回复
怎么没人回啊
各位帮帮忙嘛!!!!!!!!!!!

28,406

社区成员

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

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