Hi!
I'm writing an e-commerce website for my company, and to process credit cards we need to post a form from the shopping cart to the script that communicates with the payment client.
But, when a user completes an order, because the items we sell are online courses, and they pop up in a new window if the transaction was successful, I need a way to keep all of the variables alive when the script that talks to the payment client returns .. Here, I'll draw it:
Cart
- user purchases something
- checkout page (they enter their cc details)
- posts to a function which adds the info to the db, and then redirects them to the payment script that talks with the application using header("Location:"..
- That script then redirects them back to the receipt page.
Now, hoping the above made sense, my problem:
When the form gets submitted and is passed through the function that adds the information to the orders database, and that function then uses header() to redirect the client to the payment script, I need to keep the $POST variables alive, because these contain all of the connection info that the client needs to use. I could put them into the url as $GET variables, but with the digital receipt that's returned the url gets dangerously close to the 2000 (and something) limit..
So! Is it possible to send headers along with the redirect script and have them accessible as $_POST variables?
If you can still understand that horribly worded question, I congratulate and thank you for reading this far, :-)
Andrew