Help - Search - Members - Calendar
Full Version: Paypal Integration on PHP website
Weborum Webmaster Forum > Web Page Design > PHP
cashblos
Hello All,

I have a simple website with 3 -5 products to sell.The payment is through paypal.

How can I get the details of a person after he has made a payment and reaches the payment thank you/success page.I need the contact info passed to an email and sent to a specific email address This email needs to have name, address, city, state, zip phone, email, and the details of the product purchased.

Thanks for your valuable time
Ryokotsusai
Last time I did anything with paypal I don't think they allowed sending info back to the thank you script.

But you could go around this by setting up a user data entry form before going to the paypal link, and using cookies/sessions, and even double them with sql to send the info, but i am not aware of a way to prevent them from skipping the payment and just jumping to the thank you script (how this would help them, I don't know, but someone would find a way).

but a simple setcookie would work to transfer the info, it just wouldn't be that secure

eg send script
CODE
<?
$name = $_POST['name from a form'];
$email = $_POST['email from form'];
//repeat for all info you want to transfer

setcookie("uname",$name,time()+86400) //time()+86400 sets the cookie to last a day,
setcookie("uemail",$email,time()+86400) //but you can remove the cookie in the thank you script.
//repeat for all info you want to transfer

echo "<html link to paypal and messages here>";
?>


eg recieve script(thank you page)

CODE
<?
if(!isset($_COOKIE['uname'])) {
  echo "<some message about the fact that they shouldn't be here>";
} else {
  echo "thank you ".$_COOKIE['uname']." for doing something";
  mail( "your@email.here", "THE EMAIL SUBJECT HERE",  "This is a message letting you know that ".$_COOKIE['uname']." at ".$_COOKIE['uemail]." just hit the thank you script with the info from the user info form", "From: your thank you page" );
  unset($_COOKIE['uname'], $_COOKIE['uemail']);
}

?>


thats a rough example, but it should work to send you the data (provided your host allows php mailing)
Ryokotsusai
QUOTE(Ryokotsusai @ Feb 6 2007, 10:33 PM) [snapback]35702[/snapback]
CODE
unset($_COOKIE['uname'], $_COOKIE['uemail']);

Sorry i was up late last night, you can unset the cookies by setting them again with a date thats past due, like
CODE
setcookie("cookiename","",time()-40);


the unset wont work on cookies pinch.gif
profsite
Hey
we have implemented paypal on lots of sites.Let us know exactly what you needs and also your IMS detaisl.


QUOTE(cashblos @ Jan 14 2007, 03:48 PM) *
Hello All,

I have a simple website with 3 -5 products to sell.The payment is through paypal.

How can I get the details of a person after he has made a payment and reaches the payment thank you/success page.I need the contact info passed to an email and sent to a specific email address This email needs to have name, address, city, state, zip phone, email, and the details of the product purchased.

Thanks for your valuable time

This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.