Cart redirect to Payment Processing Web Site & Submitting data to MySQL Database

Hi,

I found a tutorial and I have a question. When a customer has entered their name, telephone number, delivery address, etc. they click ‘continue’ and they then go through to the Card Processing company (SagePay, WorldPay etc.).

As you probably know when submitting a form using post you use the code:

<form action="insert.php" method="post">

within the insert.php coding I would use a function (the function might be coded on a separate php page) that enters the data into the database .

If I send customers to the Customer Processing page the code above would have to be:

<form action="worldpay-payment-page.php" method="post">

And I would not be able to edit their web page to include the function to add content to the MySQL Database. Is there a way to post to one page and have the customer be redirected to another.

The only way I see it could be done is with a auto-redirect so that they go to insert.php and then they automatically get redirected to the Payment Processing company web page. But in my experience I have never bought something online and been to one page that send data to a MySQL Database and then automatically redirected to the payment processing company…it just goes straight to the payment screen at the Processing Company.

I hope you know a better way to get around this issue.

Matt.

This AJAX method uses JavaScript - I would like to avoid this. Is there a way to send info to a database and redirect to a chosen page?

Is the only method to “post” the data to a another php page and then store the data that way!?

Matt.

On submit you could use AJAX to add any records you need to your database first and if the insert is successful AJAX could return a string, say “success”, after which you submit the form to [COLOR=Black]worldpay-payment-page.php from your AJAX function.

[/COLOR]

AJAX

What is AJAX?

I do not want to use coding languages that some computers cannot process. For example, I am not using any JavaScript since we have had complaints from customers saying that they cannot use the parts of the site with JavaScript so they have to buy over the phone instead. I’m sure some do not bother calling at all!

So is AJAX online available with some browsers? Limited in compatibility to computers in some way? Please explain.

Matt.