Copy link to clipboard
Copied
I have created a website that a user selects a PayPal subscription for lets say $9.95 per month. I got the PayPal working on my site to go up to the purchase. However, I heard that there is a way that PayPal is able to connect or send something to my MySQL database inserting the user information so that the user can have access to the website rather than inserting the information manually when I get the papal confirmation. If someone can explain to me how the procedure if it is possible to have PayPal info of what the user subscribed to back to my MySQL database and not need to enter the information manually. Here is what I have.
MySQL database for the user
CREATE TABLE IF NOT EXISTS `payaccthist` (
`payhistid` varchar(35) NOT NULL,
`date` date NOT NULL,
`userid` varchar(35) NOT NULL,
`acctexpir` date DEFAULT NULL,
`regcostid` varchar(35) NOT NULL DEFAULT '',
`approved` tinyint(4) NOT NULL DEFAULT '0' COMMENT 'Only to show',
PRIMARY KEY (`payhistid`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Snippet of PayPal page
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_blank">
<input type="hidden" name="cmd" value="_xclick-subscriptions" />
<input type="hidden" name="business" value="me@me.com" />
<input type="hidden" name="lc" value="CA" />
<input type="hidden" name="item_name" value="<?php echo $monthsSelected; ?> Month(ly) Subscription" />
<input type="hidden" name="item_number" value="<?php echo $monthsSelected; ?> months" />
<input type="hidden" name="no_note" value="1" />
<select name="a3">
<?php do { ?>
<option value="<?php echo $row_getMonthly['cost']; ?>"><?php echo $row_getMonthly['cost']; ?></option>
<?php } while ($row_getMonthly = mysql_fetch_assoc($getMonthly)); ?>
</select>
<br />
<input type="hidden" name="currency_code" value="CAD" />
<input type="hidden" name="src" value="1" />
<!--Continous billing for 12 months-->
<select name="srt">
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
<option value="6">6</option>
<option value="7">7</option>
<option value="8">8</option>
<option value="9">9</option>
<option value="10">10</option>
<option value="11">11</option>
<option value="12">12</option>
</select>
Months <br />
<input type="hidden" name="t3" value="M" />
<input type="hidden" name="sra" value="1" />
<input type="hidden" name="p3" value="1" />
<input type="hidden" name="bn" value="PP-SubscriptionsBF:btn_subscribeCC_LG.gif:NonHostedGuest" />
<input type="hidden" name="receiver_email" value="me@me.com" />
<input type="hidden" name="custom" value="User: <?php echo $row_getUseSubscription['username']; ?> is <?php echo $row_getUseSubscription['f_name']; ?> <?php echo $row_getUseSubscription['l_name']; ?>" />
<br />
<input type="image" src="https://www.sandbox.paypal.com/en_US/i/btn/btn_subscribeCC_LG.gif" border="0" name="submit" alt="PayPal Gateway - The safer, easier way to pay online!" />
<img alt="" border="0" src="https://www.sandbox.paypal.com/en_US/i/scr/pixel.gif" width="1" height="1" />
</form>
Thank you for your responses.
Copy link to clipboard
Copied
Do you want to get the IPN confirmation?
Its not clear what you mean by: "PayPal is able to connect or send something to my MySQL database inserting the user information so that the user can have access to the website"
Or do you want the users details to come across onto the paypal payment page?
Copy link to clipboard
Copied
What I want to know is it possible that when a user pays a subscription on my site using PayPal Subscription button submitting PHP code. Is there a way that if a user pays for a subscription on my site and when he/she pays that there is a way of PayPal submitting me back to me in php code that will insert that users information that now this user can have access to the website. Is there such a thing?
Copy link to clipboard
Copied
Hi,
Yes there is: Google this: PHP Toolkit for PayPal v0.51
It is a php Paypal processing script, with IPN, it can send a notification back to your database.
You will need a field in your database to hold the response.
The file paypal will write back to should have a database connection and a insert statement.
I have used this with great success.
Copy link to clipboard
Copied
That is so neat.
I had no idea there was something like that out there.
I tried to do a search of of the "PHP Toolkit for PayPal v0.51" however, I cannot find the script. At one link it directed me to the PayPal website but I got an error on my browser saying to not download. I do not know what that is about.
Can you please send me the link to the site that has helped you. I really appreciate it.
Thank you so much for your knowledge.
Copy link to clipboard
Copied
I cant find it either.
I have it on my laptop at home. When I go home, I will upload it somewhere or email it to you.
Copy link to clipboard
Copied
Thank you, I look forward to it.
Copy link to clipboard
Copied
Were you able to find it on your laptop and uploaded?
I am looking forward to getting my hands on it.
Have a great day.
Thank you.
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more