faqts : Computers : Programming : Languages : Asp : ASP/VBScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

32 of 75 people (43%) answered Yes
Recently 2 of 10 people (20%) answered Yes

Entry

In ASP, how do I hide the URL when posting variables from a form?

Feb 12th, 2003 08:50
Jason Benson, headshot,


You are referring to the difference in GET and POST form method.
With this example the form uses the GET Method, this is probably what 
you ar currently using:
<form name="myform" method="get" action="test.asp">
  <input type="text" name="textfield">
  <input type="submit" name="Submit" value="Submit">
</form>
after submitting this form the url would appear like:
http://some_domain_name.com/test.asp?textfield=SOMEVALUE&Submit=Submit
You would then use the Request.QueryString("textfield") method to 
retrieve the value.
The POST form method will post to the page and values are not apparent 
in the URL, Example:
<form name="myform" method="post" action="test.asp">
  <input type="text" name="textfield">
  <input type="submit" name="Submit" value="Submit">
</form>
after submitting this form the url would appear without the 
querystrings:
http://some_domain_name.com/test.asp
You would then use the Request.Form("textfield") method to retrieve the 
value.
hth
jb



© 1999-2004 Synop Pty Ltd