Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 239
  • Last Modified:

Passing mulitple variables in querystring

Passing mulitple variables in querystring syntax error, see attmept below, please help thanks

"orderSuccessful_mine.asp?ItemTitle="&strItemTitle&"&"CustomerName="&strCustomerName
0
rabbits2
Asked:
rabbits2
  • 5
  • 5
  • 5
  • +1
2 Solutions
 
R_HarrisonCommented:
Try...

orderSuccessful_mine.asp?ItemTitle="&strItemTitle&"&CustomerName=" & strCustomerName

0
 
Ashish PatelCommented:
"orderSuccessful_mine.asp?ItemTitle=" & strItemTitle & "&CustomerName=" & strCustomerName
0
 
rabbits2Author Commented:
These do not seem to work, the querystring passed looks like this:
/orderSuccessful_mine.asp?ItemTitle=testingyou&crypt=JiAJOyEASw

And if I response.write on the reulting page like this:
strName=Request.QueryString("CustomerName")
Response.write "Name:"
Response.write strName
strTitle=Request.QueryString("ItemTitle")
Response.write "Title:"
Response.write strTitle

I get this:
Name:Title:testingyou
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
R_HarrisonCommented:
You are passing values called, "ItemTitle" and "crypt",  but asking for "CustomerName" and "ItemTitle", otherwise your code will work.
0
 
rabbits2Author Commented:
This is my url code:

strPost=strPost & "&SuccessURL=" & strYourSiteFQDN & strVirtualDir & "/orderSuccessful_mine.asp?ItemTitle="&strItemTitle&"&CustomerName=" & strCustomerName

I am using it to pass info to my successful page it bounces through Protx who handle the secure transaction and if successful redirect the user to my successful page. As you can see I am passing the two variables ItemTitle and CustomerName the crypt variable is secure data fro Protx.
In Protx's tech notes this is how they say you should customise the successful url:

Therefore if you wish to pass additional "name=value" pairs to the SuccessURL or FailureURL, such as the customer's name and delivery address and perhaps your own order reference, then you will need to append these extra "name=value" pairs to the Success / Failure URL upon transaction registration. When redirection occurs the VSP Form system will append to the SuccessURL or FailureURL not only a field called CRYPT but also the extra "name=value" pairs in the following manner:

[ResponseURL]?CustomerName=protx&DeliveryAddress=London&OrderRef=123abc&crypt=[encrypted_information]

e.g.

http://www.YourSuccessPage.co.uk/completed.asp?CustomerName=protx&DeliveryAddress=London&OrderRef=123abc&crypt=b1cZVgcRHDUwL
SstXgFBZQsAQApaUnF9SmQOJQxAHycEBkAEWEULOAEwKiYATEwUe2JRdg0QK

Can anyone work it out, thanks
0
 
Ashish PatelCommented:
Try this as CompanyName doesnot exists in your Query String passed.
strName=Request.QueryString("crpyt")
Response.write "Name:"
Response.write strName
strTitle=Request.QueryString("ItemTitle")
Response.write "Title:"
Response.write strTitle
0
 
Ashish PatelCommented:
Write the below in orderSuccessful_mine.asp file and try
strName=Request("CustomerName")
Response.write "Name:"
Response.write strName
strTitle=Request("ItemTitle")
Response.write "Title:"
Response.write strTitle
0
 
R_HarrisonCommented:
Try swapping your url code for this.

strPost=strPost & "?SuccessURL=" & strYourSiteFQDN & strVirtualDir & "/orderSuccessful_mine.asp?ItemTitle="&strItemTitle&"&CustomerName=" & strCustomerName
0
 
rabbits2Author Commented:
I get the same result
0
 
R_HarrisonCommented:
OK, seems like protx isn't handling things properly.  If these are the only variables you need you could combine into a single variable which it appears protx can handle.   Here goes the code.

To generate the URL

strPost=strPost & "&SuccessURL=" & strYourSiteFQDN & strVirtualDir & "/orderSuccessful_mine.asp?passvarbs=" & strItemTitle & "|" & strCustomerName

Then to get the variables back use.

passedvarbs=request("passvarbs")
a_passedvarbs=Split(passedvarbs, "|")
strItemTitle=a_passedvarbs(0)
strCustomerName=a_passedvarbs(1)
response.write(strItemTitle)
response.write(strCustomerName)
0
 
R_HarrisonCommented:
Sorry, i'm not really happy with my solution but if its works then....   It maybe to do with the length of the URL you are using, ideally you should take it up with protx.
0
 
Ashish PatelCommented:
Did you try placing this code in orderSuccessful_mine.asp file ?

strName=Request("CustomerName")
Response.write "Name:"
Response.write strName
strTitle=Request("ItemTitle")
Response.write "Title:"
Response.write strTitle
0
 
rabbits2Author Commented:
Yes same result
0
 
Ashish PatelCommented:
Can you please paste the code of you  orderSuccessful_mine.asp file?
0
 
swinslowCommented:
Your original Querystring you wrote has a quote after the ampersand for CustomerName. So I am going to guess that you are getting an error "Expected end of statement". Your querystring that you are trying to write should look like this:
"orderSuccessful_mine.asp?ItemTitle=" & &strItemTitle & "&CustomerName=" & strCustomerName

So just a matter of a typo.

Another way to test your QueryString values is on your processing page:
 For each QSName in Request.QueryString
      Response.Write QsName & " = " & Request.QueryString(QSName) & "<br>"
Next

Soren


0
 
rabbits2Author Commented:
I think it was a Protx specific way of processing the data I have figured it out and here is my final result:

strPost=strPost & "&SuccessURL=" & strYourSiteFQDN & strVirtualDir & "/orderSuccessful_Sat2.asp?ItemPrice="&strItemAmount&"&ItemID="&strItemID&"&CustomerApp="&strCustomerName&"&ItemQuantity="&strThisQuantity&"&TotalAmount="&strTotalAmount&"&ItemTitle="&strItemTitle&"&ItemAddress="&strDeliveryAddress&"&ItemPostCode="&strDeliveryPostCode&"&CustomerEmail="&strCustomerEMail&"&ItemCategory="&strItemCategory&"&ItemSize="&strItemSize&""

Only change I have made is not to pass the customer name,address and postcode in querysting for security reasons.
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

  • 5
  • 5
  • 5
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now