Example Worldpay PHP/MySQL Callback?

Hello experts,

I am trying to figure out how to work Worldpay's callback (payment response) system, I get that WP blurt all the details back to an address (www.domain.com/callback.php), but I'm at a lost what to do with that information .. more importantly, how to get the data they send into a MySQL db (I have that setup an can connect to it to submit/retrieve data for example).

Worldpay typically not very helpful for beginners (http://www.rbsworldpay.com/support/kb/bg/paymentresponse/payment_response.html)

Any help/examples extremely welcome! Total n00b so please be gentle!
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

They pass it back as POST data:


this means you can access it in php using $_POST['x'] for whatever the variable names are respectively.

in your script, you would then,

(1) connect to your MySQL db: mysql_connect('host','username','password');
(2) select your db: mysql_select_db('my_db');
(3) send your query mysql_query('INSERT INTO my_table (my_field, my_field_2) VALUES ' . $_POST['my_field'] . ',' . $_POST['my_field']);

for (3), you will need to use single quotes if these are string values and ideally you will need to scrub the data to make sure no one can use a SQL injection attack.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Have a look at the following:


anelson2008Author Commented:
Spot on! Thank you both very much.
Glad to assist
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.