类似侍道的游戏:asp <form mothed="get" action="into.asp?msgto=nihao">

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/28 16:59:18
in.asp代码:
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head>

<body>
<form method="get" action="into.asp?msgto=check">
<p><input type="submit" value="提交" name="B1"></p>
</form>
</body>

</html>

into.asp代码:

<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head>

<body>
<% =request.querystring("msgto")%>

</body>

</html>

怎么不像教程上说得那样 in.asp中的msgto变量的值传递到into.asp中。问题出在哪里?能不能具体的讲一样 action=""的具体使用?谢谢。
不是用get方法就用request.querystring("name")获取变量值;用post方法就用request.form("name")获取变量值吗?为什么下面用post方法而使用request.querystring("name")获取变量值?为什么用request.form("name")就不能获得变量值(测试过)?请给各合理解释,谢谢。

<%
hid=request.form("hid")
if hid="" then %>
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
</head>

<body>
<form method="post" action="into.asp?msgto=check">
<p><input type="submit" value="提交" name="B1">
</p>
<input name="hid" type="hidden" value="ok">
<input name="text" type="text" value="0000">
</form>
</body>

</html>
<% else
a=request.form("text")
b=request.querystring("msgto")
response.write a
response.write b
end id'具体的你在看看,这样原理是对的,没有测试
%>

你用get方法提交的值是form里的值,如果用action="into.asp?msgto=check"传递msgto的值,把get方法改为post方法即可

<form method="post" action="into.asp?msgto=check">