Hi guys,

I'm hoping someone can help me out, I'm trying to set-up a PayPal IPN that adds certain details of my payment to a database but I'm having problems and I can't work out what I've done wrong. Any help would be greatly appreciated.

ipnconfig.php - This is the file with my Database Settings and it opens the MySQL connection. * I've removed some details for security reasons *
PHP Code:
<?php
/**  Connection Variables
*/
    
$DB_HOST "localhost";
    
$DB_NAME "gieli436_purchases";
    
$DB_USER "gieli436_puruser";
    
$DB_PASS "removed";    
    
$CONNECTION mysql_connect($DB_HOST$DB_USER$DB_PASS);
    
    
/** * Establish MySQL Connection*/
    
mysql_select_db('' $DB_USER '_' $DB_NAME ''$CONNECTION);
Below is the PayPal form code, I'm trying to get the variables username and creditamount saved in my database.

PHP Code:
<form action="https://www.paypal.com/cgi-bin/webscr" method="post" target="_top">
<
input type="hidden" name="cmd" value="_s-xclick">
<
input type="hidden" name="hosted_button_id" value="FWE3J9J8NQEHL">
<
table>
<
tr><td><input type="hidden" name="on0" value="Amount">Amount</td></tr><tr><td><select name="os0">
    <
option value="100 Credits">100 Credits $1.00 USD</option>
    <
option value="200 Credits">200 Credits $2.00 USD</option>
    <
option value="300 Credits">300 Credits $3.00 USD</option>
</
select> </td></tr>
<
tr><td><input type="hidden" name="on1" value="Username">Username</td></tr><tr><td><input type="text" name="os1" maxlength="200" value="{$mybb->user['username']}"></td></tr>
</
table>
<
input type="hidden" name="currency_code" value="USD">
<
input type="image" src="/purchase.png" border="0" name="submit" alt="PayPal  The safer, easier way to pay online.">
<
img alt="" border="0" src="https://www.paypalobjects.com/en_GB/i/scr/pixel.gif" width="1" height="1">
</
form
Do I need to change on0 or os1 ? I don't understand what these do but I'm trying to store the Username to update the username column and the amount to update the creditamount column.