Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

proper syntax for multiple parameters sent as querystring

Status
Not open for further replies.

aonefun

Technical User
May 21, 2007
79
US
Is this the proper syntax for passing on more than one querystring parameter? and if not, what is the proper syntax?:

Response.Redirect("results_postcode.asp?PostalCode='"&Request.Form("PostalCode")&"'"&VendorPartNumber='"&Request.Form("VendorPartNumber")&"'")
 
Separator for querystring parameters is usually a question mark.

Try (all one line)
Code:
Response.Redirect("results_postcode.asp?PostalCode='" & Request.Form("PostalCode") & "'?VendorPartNumber='" & Request.Form("VendorPartNumber") & "'")

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
Separator for querystring parameters is usually a question mark.

No it's not?! Its an ampersand (&).

aonefun, the only thing wrong with your code is you have included apostrophes around your variables. You dont need them unless you specifically require them.

Code:
Response.Redirect("results_postcode.asp?PostalCode=" & Request.Form("PostalCode")& "&VendorPartNumber="& Request.Form("VendorPartNumber"))

Cheers

Nick

where would we be without rhetorical questions...
 
and if you want to get really into it you should use & not just & in this lovely day and age of xhtml

You are kidding here right?

where would we be without rhetorical questions...
 
Well spotted - my bad - another of my senior moments!

___________________________________________________________
If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
Steam Engine Prints
 
That's all the same an interesting point and you deserve some credit. My only thinking on the client-side though is that validation is at the service of scripter, not scripter slave of the validation engine.

As a supplementary note, the only thing rests to consider is that urlencoding of the paramenters, in the form of request.form(). If there is a real possibility of unsafe characters there, one should apply server.urlencode() to them in the construction of the querystring.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top