PayPal to MySQL Database...
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.
