formhandler.asp
<html>
<body>
<%
dim requestmethod
requestmethod = request.servervariables("request_ method")
' 获取request_method的数值,并把它存入本地的变量中.当web页面被表单标记的action参数调用时,requestmethod的数值为post.其他时候, 用户直接向浏览器中键入地址,刷新页面,或单击页面的一个链接而调用页面,request_method的数值是get.
if requestmethod = "get" then
' 检查request-method的数值.if结构含有一个块代码,当条件为真时被执行,含有一个else块,条件为假时被执.刷新页面.
%>
噢,您现在不能刷新并浏览屏幕当前内容!如果想更改表单数据,请用后退键回到表单,或按提交返回.
<%else
%>欢迎光临随风起舞!
' 按下表单提交按钮显示.
<%
= request.form("name")
%>.
<p>您最喜欢的国产汽车:
<%dim favcaramre
favcaramre = request.form("caramre")
if favcaramre = "olympus " then
response.write("噢,请稍候!")
response.write("<p>a <b>olympus </b>?")
else
response.write(favcaramre & ".<p>棒极了!")
end if
%>
<%end if%>
</body></html>
发表评论