Link to home
Start Free TrialLog in
Avatar of rabbits2
rabbits2

asked on

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
ASKER CERTIFIED SOLUTION
Avatar of R_Harrison
R_Harrison
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rabbits2
rabbits2

ASKER

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
You are passing values called, "ItemTitle" and "crypt",  but asking for "CustomerName" and "ItemTitle", otherwise your code will work.
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
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
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
Try swapping your url code for this.

strPost=strPost & "?SuccessURL=" & strYourSiteFQDN & strVirtualDir & "/orderSuccessful_mine.asp?ItemTitle="&strItemTitle&"&CustomerName=" & strCustomerName
I get the same result
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)
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.
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
Yes same result
Can you please paste the code of you  orderSuccessful_mine.asp file?
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


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.