http://www.aygfsteel.com/ebecket 返還網
          隨筆-140  評論-11  文章-131  trackbacks-0

          A:

          request.querystring 是用來接收地址里面?后面的xx=xx的內容 
          而request.form 是用來接收表單遞交來的數據 
          不過我可以告訴你個兩全其美的方法 

          例如 request("offline") 
          就無論采用的是以上哪種方法的字段值都可以讀取了

          B:

          request.form是指用form遞交過來的數據。而request.querystring則是指用URL遞交過來的。你用的是login.asp?offline=true,這個當然是URL遞交的啦。

          C:

          Request.Form和Request.QueryString兩個接收參數來源不同,前者是接收從表單Form來的參數,后者是從URL來的參數。 

          你這有這一句logon.asp?offline=true這是URL的傳遞參數。 

          如果要用Request.Form()的話,那頁面至少得有個表單,比如: 

          <form name=form1 method=post action=logon.asp> 
          <input type=text name=user value=""> 
          </form> 

          這樣在提交過表單后,就可以用Request.Form("user")得到這個文本框傳遞過來得數值。

           

          D:

          request.querystring和request.form的區別 
          request.querystring是用post方法讀取的 不安全 
          request.form是用get方法讀取的 
          form表單中的method中看你是get還是post 

          <html> 
          <head> 
          <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
          <title>無標題文檔</title> 
          </head> 

          <body> 
          <p> 
          <% 
          if request.querystring("offline")="true" then 
          session.Abandon() 
          response.Redirect("login1.htm") 
          end if 
          %> 
          歡迎進入:<%=request.Form("user")%></p> 
          <p>當前聯機人數為:</p><%=application("onlinenum")%> 
          <p><a href=login.asp?offline=true>離開</a></p> 
          </body> 
          </html>

          posted on 2009-10-16 14:12 becket_zheng 閱讀(739) 評論(1)  編輯  收藏 所屬分類: web前端開發

          評論:
          # re: request.querystring和request.form的區別 2015-05-28 22:29 | mesurpass
          request.querystring是用post方法讀取的 不安全
          request.form是用get方法讀取的 這說的不對吧  回復  更多評論
            
          <2025年7月>
          293012345
          6789101112
          13141516171819
          20212223242526
          272829303112
          3456789

          常用鏈接

          留言簿

          隨筆分類(138)

          隨筆檔案(134)

          文章分類(77)

          文章檔案(109)

          email

          常去的Blog

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 伊宁市| 山丹县| 开封市| 彭水| 温州市| 同德县| 富锦市| 锦屏县| 石林| 巫山县| 塘沽区| 邳州市| 古田县| 乐平市| 通化县| 呼伦贝尔市| 祥云县| 兰州市| 镇康县| 宣恩县| 彰武县| 丁青县| 泾阳县| 泰州市| 贡嘎县| 蚌埠市| 纳雍县| 凤山县| 神池县| 奉节县| 青浦区| 海丰县| 和平区| 青阳县| 赤壁市| 潼关县| 德钦县| 弥渡县| 防城港市| 新疆| 舒兰市|