区别:
post是允许传输大量数据的方法,而get方法会将所要传输的数据附在网址后面,然后一起送达服务器,因此传送的数据量就会受到限制,但是执行效率却比post方法好。
建议:
1、get方式的安全性较post方式要差些,包含机密信息的话,建议用post数据提交方式;
2、在做数据查询时,建议用get方式;而在做数据添加、修改或删除时,建议用post方式;
method的属性值为post时,所有作为请求提交的<form>段中的html控件单元的值的集合,每个成员均为只读。(用于检索http请求正文中表单元素的值。)
sub.htm:注意方法是post
<form action="demo.asp" method=post>
<input type=text name="content" size=20>
<input type=submit value="提交">
</form>
demo.asp:
<%dim textcon
textcon=request.form("content")
response.write textcon %>
querystring 表单信息通过get方式发送时,服务器端或另一个asp页面就使用querystring方法接收。(用于检索http查询字符串中变量的值。)
sub.htm:注意方法是get
<form action="demo.asp" method=get>
<input type=text name="content" size=20>
<input type=submit value="提交">
</form>
demo.asp:
<%dim textcon
textcon=request.querystring("content")
response.write textcon %>
此例中,你不用sub.htm,在地址栏中输入demo.asp?content=演示querystring看看。request.form可不能这样做。