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= "&strItemT itle&"&"Cu stomerName ="&strCust omerName
"orderSuccessful_mine.asp?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You are passing values called, "ItemTitle" and "crypt", but asking for "CustomerName" and "ItemTitle", otherwise your code will work.
ASKER
This is my url code:
strPost=strPost & "&SuccessURL=" & strYourSiteFQDN & strVirtualDir & "/orderSuccessful_mine.asp ?ItemTitle ="&strItem Title&"&Cu stomerName =" & 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&Del iveryAddre ss=London& OrderRef=1 23abc&cryp t=[encrypt ed_informa tion]
e.g.
http://www.YourSuccessPage.co.uk/completed.asp?CustomerName=protx&DeliveryAddress=London&OrderRef=123abc&crypt=b1cZVgcRHDUwL
SstXgFBZQsAQApaUnF9SmQOJQx AHycEBkAEW EULOAEwKiY ATEwUe2JRd g0QK
Can anyone work it out, thanks
strPost=strPost & "&SuccessURL=" & strYourSiteFQDN & strVirtualDir & "/orderSuccessful_mine.asp
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
e.g.
http://www.YourSuccessPage.co.uk/completed.asp?CustomerName=protx&DeliveryAddress=London&OrderRef=123abc&crypt=b1cZVgcRHDUwL
SstXgFBZQsAQApaUnF9SmQOJQx
Can anyone work it out, thanks
Try this as CompanyName doesnot exists in your Query String passed.
strName=Request.QueryStrin g("crpyt")
Response.write "Name:"
Response.write strName
strTitle=Request.QueryStri ng("ItemTi tle")
Response.write "Title:"
Response.write strTitle
strName=Request.QueryStrin
Response.write "Name:"
Response.write strName
strTitle=Request.QueryStri
Response.write "Title:"
Response.write strTitle
Write the below in orderSuccessful_mine.asp file and try
strName=Request("CustomerN ame")
Response.write "Name:"
Response.write strName
strTitle=Request("ItemTitl e")
Response.write "Title:"
Response.write strTitle
strName=Request("CustomerN
Response.write "Name:"
Response.write strName
strTitle=Request("ItemTitl
Response.write "Title:"
Response.write strTitle
Try swapping your url code for this.
strPost=strPost & "?SuccessURL=" & strYourSiteFQDN & strVirtualDir & "/orderSuccessful_mine.asp ?ItemTitle ="&strItem Title&"&Cu stomerName =" & strCustomerName
strPost=strPost & "?SuccessURL=" & strYourSiteFQDN & strVirtualDir & "/orderSuccessful_mine.asp
ASKER
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("passv arbs")
a_passedvarbs=Split(passed varbs, "|")
strItemTitle=a_passedvarbs (0)
strCustomerName=a_passedva rbs(1)
response.write(strItemTitl e)
response.write(strCustomer Name)
To generate the URL
strPost=strPost & "&SuccessURL=" & strYourSiteFQDN & strVirtualDir & "/orderSuccessful_mine.asp
Then to get the variables back use.
passedvarbs=request("passv
a_passedvarbs=Split(passed
strItemTitle=a_passedvarbs
strCustomerName=a_passedva
response.write(strItemTitl
response.write(strCustomer
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("CustomerN ame")
Response.write "Name:"
Response.write strName
strTitle=Request("ItemTitl e")
Response.write "Title:"
Response.write strTitle
strName=Request("CustomerN
Response.write "Name:"
Response.write strName
strTitle=Request("ItemTitl
Response.write "Title:"
Response.write strTitle
ASKER
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
"orderSuccessful_mine.asp?
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
Next
Soren
ASKER
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 ="&strItem Amount&"&I temID="&st rItemID&"& CustomerAp p="&strCus tomerName& "&ItemQuan tity="&str ThisQuanti ty&"&Total Amount="&s trTotalAmo unt&"&Item Title="&st rItemTitle &"&ItemAdd ress="&str DeliveryAd dress&"&It emPostCode ="&strDeli veryPostCo de&"&Custo merEmail=" &strCustom erEMail&"& ItemCatego ry="&strIt emCategory &"&ItemSiz e="&strIte mSize&""
Only change I have made is not to pass the customer name,address and postcode in querysting for security reasons.
strPost=strPost & "&SuccessURL=" & strYourSiteFQDN & strVirtualDir & "/orderSuccessful_Sat2.asp
Only change I have made is not to pass the customer name,address and postcode in querysting for security reasons.
ASKER
/orderSuccessful_mine.asp?
And if I response.write on the reulting page like this:
strName=Request.QueryStrin
Response.write "Name:"
Response.write strName
strTitle=Request.QueryStri
Response.write "Title:"
Response.write strTitle
I get this:
Name:Title:testingyou