ASP querystring
- 提问者网友:你在我心中是最美
- 2021-04-27 21:08
- 二级知识专家网友:眠于流年
- 2021-04-27 22:10
get方式
<html>
<body>
<form method="get" action="">
姓名:<input type="text" name="name"><br>
密码:<input type="password" name="pwd"><br>
性别:<select name="gender">
<option>男</option>
<option>女</option>
</select><br>
<input type="submit" name="submit" value="提交">
<input type="reset" name="submit1" value="重置">
</form>
<%@ language=VBScript %>
<%
response.expires=0
sname=request.Querystring("name")
spwd=request.Querystring("pwd")
ssex=request.Querystring("gender")
%>
姓名:<%=sname%><br>
密码:<%=spwd%><br>
性别:<%=ssex%><br>
URL后面的字符串: <Br>
<%= Request.ServerVariables("Query_String")%>
</body>
</html>
- 1楼网友:白日梦制造商
- 2021-04-27 22:49
1,
<form method="get" acion="1.asp">
<input type="text" name="text1" />
<input type="submit" />
</form>
这是一个get方式提交的表单,action后面是1.asp,所以就可以在1.asp中用querystring获取text1的值代码如下
<%
dim text1
text1=request.querystring("text1")
document.write(text1)
%>
2.
还是1.asp
假设你的地址为localhost
那么直接访问
http://localhost/1.asp?text1=123
代码还和上边一样