Jump to content

the form, the MySQL, the Payapl and the ugly


redshark50

Recommended Posts

Hello all

 

I've been pondering on this for a day now and haven't come up with a good/relevant solution and hoped anyone here could help.

 

Basically, I've got an HTML form that submits the data to MySQL and this all works perfectly fine. The stumbling block arrived last night when I was told that instead of the submit button it needed to be a PayPal purchase button. The user needs to fill out the form and is then charged for submitting the data.

 

I need to get the data from the form, go through PayPal and then once payment is completed insert the form data into the database.

 

I wondered if it is possible to send the data to a temporary table whilst the user goes to PayPal and then on payment the data is pulled from the temp table and insert in the 'real' table? However, I don't know how to send data AND direct to the paypal link with one submit button, is it possible?

 

Let me know if I'm talking gibberish, or if you need to know any further info.

 

Thanks in advance

James

Link to comment
Share on other sites

have a look at Paypal's IPN documentation. essentially, IPN allows you to tell Paypal to execute a certain script on your server when the payment is passed through - you just need to write the script that will handle this, which entails checking what the payment's result was and then doing the appropriate task based on that result.

 

your best bet is likely to pass them from the paypal button to an interim page (on your server), where you insert the info into a database along with a flag that designates it as an unpaid listing, and header() them onto the Paypal payment page. this could be tricky, since using header() may spark a caution message in the browser (can't remember off the top of my head), but it's worth a shot. then set IPN to point to a script on your server, and if the payment comes back as successful, simply switch the flag in the database to designate that the listing is paid for.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.