为什么老是提交两次呢,烦死啦100 分
<!--#INCLUDE file="data.asp" -->
<html>
<head>
<title></title>
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<script language="Javascript" >
function PressKey()
{
if(window.event.keyCode==13)
{
document.form1.op.value='Send'
this.document.form1.submit();
// document.form1.Submit.Click();
}
}
function SetFocus()
{
document.form1.message.focus();
}
</script>
<%
on error resume next
op = request("op") ''客户的操作
if(vartype(op) < 2 or op = "")then
op="newcome"
end if
Select case op
Case "newcome"
'会议编号
Session("MeetingNo") = int(Request("MeetingNo"))
'此会议人数加1
dim MeetingManCountNewCome()
redim MeetingManCountNewCome(Application("MeetingCount") - 1)
for i = 0 to Application("MeetingCount") - 1
MeetingManCountNewCome(i) = Application("MeetingManCount")(i)
next
MeetingManCountNewCome(Session("MeetingNo") - 1) = MeetingManCountNewCome(Session("MeetingNo") - 1) + 1
Application.lock
Application("MeetingManCount") = MeetingManCountNewCome
Application.UnLock()
''进入会场提示
dim msgNewCome()
redim msgNewCome(Application("MeetingCount") - 1)
for i = 0 to Application("MeetingCount") - 1
msgNewCome(i) = Application("msg")(i)
next
msgNewCome(Session("MeetingNo") - 1 ) =cstr(time()) & "<font color=blue>" & " " & Session("Rname") & ":" & "</font>" & " " & "<font color=green>进入会场</font>" & "<br>" & msgNewCome(Session("MeetingNo") - 1 )
Application.lock
Application("msg") = msgNewCome
Application.UnLock()
Case "Send"
''会议是否结束
if(Application("MeetingStart")(Session("MeetingNo") - 1) = 0 )then
response.Redirect("welcome.asp")
end if
''发出信息
if(request("message") <> "" and vartype(request("message")) >=2)then
dim msgsend()
redim msgsend(Application("MeetingCount") - 1)
for i = 0 to Application("MeetingCount") - 1
msgsend(i) = Application("msg")(i)
next
'Application("submit")= Application("submit") + 1
msgsend(Session("MeetingNo") - 1) = cstr(time()) & "<font color=blue>" & " " & Session("Rname") & ": " & "</font>" & Server.htmlEncode(request("message")) & "<br>" & msgsend(Session("MeetingNo") - 1)
Application.lock
Application("msg")=msgsend
Application.unlock
end if
Case "Exit"
''此会议人数减1
dim MeetingManCountExit()
redim MeetingManCountExit(Application("MeetingCount") - 1)
for i = 0 to Application("MeetingCount") - 1
MeetingManCountExit(i) = Application("MeetingManCount")(i)
next
MeetingManCountExit( Session("MeetingNo") - 1 ) = MeetingManCountExit( Session("MeetingNo") - 1 ) - 1
Application.lock
Application("MeetingManCount") = MeetingManCountExit
Application.UnLock()
''退出会场提示
dim msgExit()
redim msgExit(Application("MeetingCount") - 1)
for i = 0 to Application("MeetingCount") - 1
msgExit(i) = Application("msg")(i)
next
msgExit(Session("MeetingNo") - 1) = cstr(time()) & "<font color=blue>" & " " & Session("Rname") & ":" & "</font>" & "<font color=red> 退出会场</font>" & "<br>" & msgExit(Session("MeetingNo") - 1)
Application.lock
Application("msg") = msgExit
Application.unlock
response.redirect("welcome.asp")
Case ELse
End Select
%>
<body leftmargin="0" topmargin="0" background="images/mainSkinBG.gif" OnLoad="SetFocus();">
<%''if(Application("MeetingStart") = 1) then %>
<table cellspacing="0" cellpadding="0" class=css2 width="100%" align="center" height="100%" bgcolor="#D9D491">
<form method="post" name= "form1" action="chat.asp">
<tr bgcolor="D9D491"><td align="right" valign="top" class="title" ><iframe name=chat frameborder="no" class=css0 width="100%" height="100%" src="chattext.asp"></iframe></td></tr>
<tr valign="top" bgcolor="D9D491">
<td height="25" align="left" valign="middle" > <b>我要发言</b>:
<input type="text" name="message" size="60" onkeydown="JavaScript:PressKey();">
<input type="hidden" name="op" value="" >
<input type="submit" name="Submit" value="发 言" accesskey="S" OnClick="vbscript:Document.all.form1.op.value='Send'"><font color="#FF0000">Alt+S</font>
<% if(Application("Meetinger")(Session("MeetingNo") - 1) = Session("Rname")) then %>
<input type="submit" name="Submit2" value="结束会议" class=css0 onclick="vbscript:Document.all.form1.op.value='EndMeeting'">
<%else%>
<input type="submit" name="Submit3" value="退 出" class=css0 OnClick="vbscript:Document.all.form1.op.value='Exit'">
<% end if %>
</td>
</tr>
</form>
</table>
<%'end if%>
</body>
</html>
<script language="javascript">
document.form1.op.value='';
</script>