home *** CD-ROM | disk | FTP | other *** search
- <%
- '*******************************************************
- '* ASP 101 Sample Code - http://www.asp101.com *
- '* *
- '* This code is made available as a service to our *
- '* visitors and is provided strictly for the *
- '* purpose of illustration. *
- '* *
- '* Please direct all inquiries to webmaster@asp101.com *
- '*******************************************************
- %>
-
- <!-- Notice the only difference in the two forms is the METHOD attribute -->
- <FORM ACTION="getpost.asp" METHOD="get">
- <INPUT TYPE="text" NAME="Text" VALUE="Hello World"></INPUT>
- <INPUT TYPE="submit" VALUE="Use Get"></INPUT>
- </FORM>
- <BR>
- <FORM ACTION="getpost.asp" METHOD="post">
- <INPUT TYPE="text" NAME="Text" VALUE="Hello World"></INPUT>
- <INPUT TYPE="submit" VALUE="Use Post"></INPUT>
- </FORM>
-
- <BR>
- <BR>
-
- <% If Request.QueryString("Text") <> "" Then %>
- The text in the box was "<B><%= Request.QueryString("Text") %></B>"<BR>
- It looks like you used "<B>get</B>" to send it.<BR>
- <BR>
- Using "get" to pass information sends the information appended to the
- request for the processing page. It tends to be simpler and you can
- troubleshoot any problems simply by looking at the address bar in your
- browser since all values passed are displayed there. This is also the
- primary weakness of this method. The data being passed is visible and
- is limited in size to the maximum length of a request string.
- <% End If %>
-
- <% If Request.Form("Text") <> "" Then %>
- The text in the box was "<B><%= Request.Form("Text") %></B>"<BR>
- It looks like you used "<B>post</B>" to send it.<BR>
- <BR>
- Using "post" to pass information sends the information embedded in a
- header during the request for the processing page. It's main advantage
- is that you can send larger amounts of information. It also doesn't
- make that information visible in the address bar of the browser which
- is nice if you are using the "hidden" input type. The value of this
- type is still readily available to the user by using view source, but
- the average user won't see it or be confused by any information you may
- need to pass from your form for processing.
- <% End If %>
-