Forum Moderators: coopster

Message Too Old, No Replies

dual action php form help

dual action php form help

         

trancendence77

5:08 am on Jan 10, 2010 (gmt 0)

10+ Year Member



I working on creating a php form that will do two (2) things...

1. submit the form information to my email; and
2. facilitate a payment transaction through paypal without redirecting the user outside of my site (i do have a paypal account set up)

would someone kindly help me with this?

-thank you!

TheMadScientist

8:40 pm on Jan 10, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Personally, I think #2's is a very insecure way of doing things, unless you have a security certificate, but if you're really determined to do it, you probably need to use AJAX... (I'm actually not sure if you can do #2 using PayPal, but it could be something I'm not familiar with since I haven't tried it before.)

rocknbil

3:07 am on Jan 11, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



1. submit the form information to my email;

There are tons of mailer examples right here on this board. You compose the mail content, headers, then execute PHP's mail command. Very very important, do not send credit card info via email. Exclude payment info from this email.

2. facilitate a payment transaction through paypal without redirecting the user outside of my site (i do have a paypal account set up)

There is only one way to do this in payPal, using Website Payments Pro [paypal.com], the old payFlow Pro system. What you do is what's called a "silent post" via pcntl_curl() (or exec a curl command, if the extensions are not installed), read the response from payPal, and act accordingly.

An SSL cert is required to do this, as it is with any other payment processor. There's no one-off solution we can post here, you'll have to log in to the payPal developer's area, get some sample code, set up a test bed, and start experimenting with it. Have lots of patience and coffee handy . . . .

trancendence77

4:25 am on Jan 11, 2010 (gmt 0)

10+ Year Member



thank you for your help! I have since been working on a solution that will work...one may still have to process the transaction outside of the site, but it will post to a database or send email or both once confirmation of the payment has successfully cleared with paypal...thanks again!