您的位置:首页 > 编程语言

在同一页面处理提交代码

2008-09-19 14:21 204 查看
可用Request.ServerVariables("Request_Method")="POST"判断是否提交,如下dice.asp页面

<html>

<head><title>测试Request_Method</title></head>

<body>

<%

Session("point")=6

If Request.ServerVariables("Request_Method")="POST" then

%>

<form method="POST" action="dice.asp">

<p>当色子的面数为<input type="text" name="T1" size="5" value=<%=session("point") %>>时</p>

<p><input type="submit" value="掷色子" name="B1"></p>

</form>

<p>掷色子的结果为:5点</p>

<%

Else

%>

<form method="POST" action="dice.asp">

<p>当色子的面数为<input type="text" name="T1" size="5" value=<%=session("point") %>>时</p>

<p><input type="submit" value="掷色子" name="B1"></p>

</form>

<%

end if

%>

</body>

</html>
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: