homepage Welcome to WebmasterWorld Guest from 54.205.52.110
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
two action within one form?
can this be done
Andy_White




msg:1252181
 7:40 pm on Oct 28, 2003 (gmt 0)

Hi,

I've got a form where the action is a redirect to a payment gateway page.
The onsubmit does javascript validation to ensure the fields are complete.

This has worked fine for a couple of years but now I want to create a mysql database entry of the customer details before they go through to the payment gateway.

I have tried having the php program that does the database entry as the action from the form with a redirect to the payment gateway in the php program, that worked but there were no values in the form by the time it got to the payment gateway.
Has anyone come across this problem and more important has anyone solved it?

Cheers

Andy

 

Birdman




msg:1252182
 8:00 pm on Oct 28, 2003 (gmt 0)

Hello,

When you redirect In your PHP/db script, add the POSTED data onto the URL.

Example:

$redirect_url = "Location: paymentgateway.com?name=$name&email=$email...etc";
header($redirect_url)

or, I think this would work:

$redirect_url = "Location: paymentgateway.com$_SERVER['query_string']";
header($redirect_url)

Andy_White




msg:1252183
 10:44 am on Oct 29, 2003 (gmt 0)

Hi Birdman,

I had thought of adding the paremeters to the payment gateway url, but the restriction on passing parameters is 255 characters I believe. This limit could easily be hit with the data being transfered so that's not an option.

Would it be possible to send the form twice?

First time to update the database and then the second time to the payment gateway?

Cheers

Andy

killroy




msg:1252184
 10:55 am on Oct 29, 2003 (gmt 0)

then you have to use the POST method and place the data in the document body from within PHP.

SN

dcrombie




msg:1252185
 1:48 pm on Oct 29, 2003 (gmt 0)

I would POST the form to one of your own pages, do the database insert, then use a utility like "curl" to forward the information to the payment gateway.

Andy_White




msg:1252186
 7:11 pm on Oct 30, 2003 (gmt 0)

Hi,

Thanks for your advice, I looked at various options, but in the end I reconfigured the results sent from the payment gateway to display a more user friendly "thank you" page and updated the database from there.

Cheers

Andy

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved