CGI posts- new to AS
CGI posts- new to AS
- Subject: CGI posts- new to AS
- From: higherpowered <email@hidden>
- Date: Sun, 30 Sep 2001 09:07:09 -0700
Hi all-
I'm just figuring this stuff out as I go along :)
I need to write a cgi script to connect with PayPal. I have the part to
grab the post data written, although I know there is a better way. I'm not
exactly sure why i've done it this way, but it seems to work. I didn't know
how to tell AS to loop through all the pairs and create them in the script
rather than me listing them manually (below is just a portion of the info
gathered).
set invoice to goOffsetInList(myArgList, "invoice")
set custom to goOffsetInList(myArgList, "custom")
set payment_status to goOffsetInList(myArgList, "payment_status")
set pending_reason to goOffsetInList(myArgList, "pending_reason")
set payment_date to goOffsetInList(myArgList, "payment_date")
set payment_gross to goOffsetInList(myArgList, "payment_gross")
set payment_fee to goOffsetInList(myArgList, "payment_fee")
set txn_id to goOffsetInList(myArgList, "txn_id")
what I need to do now is post this info back to another URL, along with one
or two more bits of info. I've got this part(below), and know how I can
return the info into a web page using the "Your Payment Status " &
payment_status & "" within the body tags, but not sure how to set it as a
post and return it to a URL. Also, as i mentioned above, is there a way to
grab the name/value pairs from the post and loop them rather than hard
coding above and below to send the post again. This way if a name/value
changes, I do not have to re-write the script (not to mention the excess
script size)
set crlf to (ASCII character 13) & (ASCII character 10)
set myHTML to "HTTP/1.0 200 OK" & crlf & "Server: MacHTTP/2.0" & crlf &
"MIME-Version: 1.0" & crlf & "Content-type: text/html" & crlf & crlf
set myHTML to myHTML & "<HTML><BODY></BODY></HTML>"
return myHTML
any help is greatly appreciated. I wrote my first script a few weeks ago to
interface between the web and our mail server, and am hooked!
Jim Sheffer
http://www.integraserve.net
email@hidden
253-638-3287
"Get paid to host your sites!"