ASP 101 - Active Server Pages 101 - Web04
The Place ASP Developers Go!



Windows Technology Windows Technology
15 Seconds
4GuysFromRolla.com
ASP 101
ASP Wire
VB Forums
VB Wire
WinDrivers.com
internet.commerce internet.commerce
Partners & Affiliates
ASP 101 is an
internet.com site
ASP 101 is an internet.com site
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

ASP 101 News Flash ASP 101 News Flash





ASP Source Code:
<!-- 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 %>

Back the the Sample Output

Back to the Sample Index


Home |  News |  Samples |  Articles |  Lessons |  Resources |  Forum |  Links |  Search |  Feedback

Internet.com
The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers