[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

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

How to receive (using ASP Clasic) variables from cgi post to url

Help please..
I'm using a simple redirect to a usa epay form for customers to complete their information and purchase an item.  Once the transaction is approved - it is redirected back to my site with the information in (post format) name/value in the url.

I want to retrieve the values and response.write it for the customer to have a receipt.
Below is the code I have so far.  I'm not sure how to retrieve the variables from the url.

<%
Request.ServerVariables(??)  (I assume I use this but not sure which ServerVariables)

frmUMAmount = Request.Form("UMamount")
frmAuthCode = Request.Form("UMauthCode")
frmRefNum = Request.Form("UMrefNum")
frmUMDescription = Request.Form("UMdescription")
%>

Payment Date: <%=date%>
Payment Amount: <%=frmUMamount%>
Order Number: <%=UMrefNum%>
Auth Code:  <%=UMauthCode%>
0
avaj
Asked:
avaj
  • 5
  • 4
  • 3
  • +1
1 Solution
 
archang3lCommented:
Hello avaj,

The code you posted should certainly work for retrieving POST (form) variables.

To retrieve querystring variables you would use:
http://www.w3schools.com/asp/showasp.asp?filename=demo_reqquery

To retrieve form post variables:
http://www.w3schools.com/asp/showasp.asp?filename=demo_simpleform

In your case there is no need to use the Request.ServerVariables, ASP already parses the query string and post information you need for it into the above mentioned QueryString and Form collections.

Regards,

archang3l
0
 
avajAuthor Commented:
It doesn't work but does it have something to do with:

The values are not coming from a form  submitted to my server.
The values are coming from a url redirect from usa epay gateway.  The gateway is sending the url in name/value pairs not querystring.
0
 
archang3lCommented:
To pass on data to your server it either has to use:

- A form post
- Querystring variables
- Some data on the referrer URL.

I seriously doubt they use the the last option though, that would be plain buggy.

I would double check the contents of Request.QueryString and Request.Form to see if what you need is not in there.

Trying writing out Request.QueryString.Count and Request.Form.Count to see if they contain anything at all.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
avajAuthor Commented:
Tried that - doesn't look like they contain anything as nothing happened.

On usa epay the documentation states: "Display Result and Post  to URL"
0
 
archang3lCommented:
You should check what really gets passed then.

Try installing Fiddler (http://www.fiddler2.com), this will allow you to see what data is passed on from EPay and should give you more information on how to access it.
0
 
kevp75Commented:
request.querystring("whateverthequerystringis")
0
 
avajAuthor Commented:
kevp75 - I'm not using the GET URL querystring option to recieve the variables but rather the post url.

Archang31 I  did manage to determine which variables are being passed using the querystring (had to change the program to GET URL first).  
 I think you are correct and my form should have worked but the variables that are being returned are different than I thought.  I have a question into epay to find out why.  

Once I hear back - I will let you know.
0
 
archang3lCommented:
Ok, good to hear you are on the right track though.
0
 
kevp75Commented:
then please explain this  >> name/value in the url.<<
0
 
effxCommented:
<%
For Each Item In Request.Form

Response.Write(Item & " = " & Request.Form(Item) & "<br />")

Next
%>
0
 
kevp75Commented:
you could also do the same for request.querystring

I keep mentioning querystring here, because so far in every post from the questioner, I see "post url".  Which is a little confusing, because there is no "post url".  There are POST headers, and GET headers which are simply methods for posting a form.   The "url" in your statement is what is throwing me off.  a url is http://www.somesite.com?somevar=somevalue&somevar2=somvalue2

please be a bit more specific.   Is it a POST?   or is it a URL?
0
 
avajAuthor Commented:
kevp75 - I'm sorry - I can see where I was confusing.  It is POST.

I should have been clearer -  the gateway is sending the information back to a specified url on my site via post. (or I should have left the url part off completely)

Hope that makes more sense.
0
 
avajAuthor Commented:
archang31 - you were right my original form was fine.  

The error was somewhere else; I needed to pass a specific variable to epay on the payment form in order for it to work correctly.

I am awarding the points to archang31 as archange originally said it should work and directed me to find out what if anything was being returned.

Sorry I hadn't worded my question better; I do appreciate everyone's help though.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

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