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 閱讀(741) 評論(1)  編輯  收藏 所屬分類: web前端開發

          評論:
          # re: request.querystring和request.form的區別 2015-05-28 22:29 | mesurpass
          request.querystring是用post方法讀取的 不安全
          request.form是用get方法讀取的 這說的不對吧  回復  更多評論
            
          主站蜘蛛池模板: 万宁市| 卓资县| 托克托县| 黄龙县| 广宗县| 旺苍县| 永和县| 临江市| 光山县| 盐边县| 广平县| 大竹县| 曲松县| 兴安县| 北海市| 霞浦县| 沛县| 南靖县| 图们市| 建湖县| 中阳县| 永善县| 龙里县| 定南县| 积石山| 贡嘎县| 屏南县| 沙雅县| 长沙市| 阜阳市| 威信县| 永和县| 井冈山市| 文安县| 长葛市| 鲁甸县| 浑源县| 乌拉特后旗| 遵义县| 西吉县| 华宁县|