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 Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Reading info from a page into a variable (ASP)

Status
Not open for further replies.

DSect

Programmer
Sep 3, 2001
191
US
Hello,

I was looking to add online purchasing to a site and I looked into it, but I have a question that I cannot find an answer to, yet.

The processing company I want to use works like this:

You POST form data to an page on their server, it processes the card, amoount, etc. and then spits back authorization info to you in the form of a delimited string on a page.

My question is: How do I get the info from the delimited string into my stuff using ASP?

Here is an example of a response page:

So I can't figure out how to read that stuff into ASP. I'd know how to separate it if I had it in a variable, but I don't know how to get the contents of a page into a variable. If it were POST'ed back to me, or if it was in the URL, I wouldn't have a problem.

So I am asking how you "read" stuff from a page with ASP/VBScript. Like if I had a simple page that said "food" on it, how could I get that into a variable, without POST or GET.

Thanks in advance.
 
They all work pretty much the same. When you submit the checkout info, they POST you the result back to the page you want. You should set this page on your admin screen. For example you set it as "final.asp". Then you can put some code at the top of the page something like

if request.form("param1") = "failed" then
response.write "Bad card - please go back and try again"
else
update_database(order_number,ref_number)
end if

You can find these parameters on your processing company's user guide.
 
Oops, I got it.

There a 2 response methods this company uses. One is to send back a delimted string (like above) and the other is to POST back to your own page. I had the wrong one set.

I switched my test script to the POST back method and it works. I knew they had a way to POST the info back to you, but I didn't enable it and that's why it sent me the delimited string, instead of POSTing to my script.

Haha.. Little case of excitement and no thorough RTFM.

Thanks for the help, though!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top