/    Sign up×
Community /Pin to ProfileBookmark

URL Variables MySQL Database

Please allow me to put out on the table my green-ness to this all.
I’ve been asked to make up a ‘pay now’ button for our company to allow our customers to pay online.
The payment gateway people have given me a list of certain vaiables that will be passed back to us upon completion of the the transaction. I would like to take that information and store it in a MySQL table.
I have setup the table to have matching variables from the gateway companies returend variables already.
My question is how do I take the information from the returned URL and parse it to information to store in the MySQL table?

This is the information being sent from them:

[QUOTE]

cgi-bin/receipt.cgi?Status=1&approval_code=xxxxx&authresponse=AUTH%20APPROVED&avs=Y&OrderID=xxx&total=x.xx&Cardname=Visa&NameonCard=John%20Doe&Cardstreet=123%20Street&Cardcity=Nowhere&Cardstate=NJ&Cardzip=0800&Cardcountry=US&email=[email protected]

[/QUOTE]

The obvious list of variables are (fields I’ve set up in MySQL)
Status
approval_code
authresponse
OrderID
total
Cardname
NameonCard
Cardstreet
Cardcity
Cardstate
Cardzip
Cardcountry
email

Thanks a ton! ?

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@stephan_gerlachOct 30.2006 — The sql statement would be this

[code=php]

$sql = 'INSERT INTO tablename VALUES ("STATUS","'.$_GET['approval_code'].'","'.$_GET['authresponse'].'","'.$_GET['OrderID'].'","'.$_GET['total'].'","'.$_GET['Cardname'].'","'.$_GET['NameonCard'].'","'.$_GET['Cardstreet'].'","'.$_GET['Cardcity'].'","'.$_GET['Cardstate'].'","'.$_GET['Cardzip'].'","'.$_GET['Cardcountry'].'","'.$_GET['email'].'");
[/code]


Not sure what you want as status but i guess you can see what how it is done
×

Success!

Help @DruKe spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...