Forum Moderators: coopster
I have recently written a custom shopping cart for an e-commerce site that links to a separate credit card processing site. The user enters their delivery details on our site, then they are transferred to the CC processor's site with their details being passed as post variables.
However, because the details a shopper enters in the final form on our site are posted directly to the CC processor, I can't access them to update a database. Is there some way of executing a script with the post variables then sending the form data to the CC processor as well in just one click for the user?
I've heard people speak of 'background posts' but I'm not sure what they are or if they're possible with PHP. I realise the problem could be solved by inserting an 'summary page' between requesting a delivery address and transfering to the CC processor, but was hoping for a more elegant solution.
Any suggestions would be much appreciated. Thanks!
I was given this code to test the variables:
foreach ($_POST as $fieldname => $value) {
echo "$fieldname is $value<br />";
}
$var1=$_GET['formvar1'];
etc.
I would then think that you could then feed them all to a form that is sent to the CC processor.
John
PS - I'm a NEWBIE.. others may have MUCH better advise.
Thanks for your suggestion.
As I understand it, although I could gather-up the post variables, do something useful with them, then populate a second form with them, the shopper would always be required to submit the second form.
I'm hoping to find a way to automate this in some way, whether it involves automatically submitting the second form (is this possible?) or using some other method.
it shows how a page can receive a post request, and then re-post the variables back to another script.
I think that's what you're looking for?