Hello,
I am facing problem with paypal payment system . I created a system where users can upload fund by paypal. after payment successfull my website database will load with those data but its not happaning. while users payment successfull there is no data in my database. i am providing you all code. please help me for that. Thank you in advance
HTML CODE IS :
<form action='https://www.paypal.com/cgi-bin/webscr' method='post' name="form" id="form">
<input type='hidden' name='business' value='seshies@gmail.com'>
<input type='hidden' name='cmd' value='_xclick'>
<input type='hidden' name='item_name' value='Recharge For My Unlock Factory Account'>
<tr>
<th>Valid E-Mail * : </th>
<td><input type="text" name='item_number' class="textfield"/></td>
</tr>
<tr>
<th>Amount * : </th>
<td><input type="text" name="amount" class="textfield"/></td>
</tr>
<input type='hidden' name='no_shipping' value='1'>
<input type='hidden' name='currency_code' value='USD'>
<input type='hidden' name='handling' value='0'>
<input type='hidden' name='cancel_return' value='http://http://www.unlockphones.org/payment-cancel'>
<input type='hidden' name='return' value='http://http://www.unlockphones.org/payment-success'>
<tr>
<td> </td>
<td> <input type="submit" style="margin-top:0px;" name="Submit" value="Buy Through Paypal" class="tsc_buttons2 red"/></td>
</tr>
</form>
PHP CODE IS :
//if user id and username not !=
$u_email = $_GET['item_number'];
$uid = $_SESSION['SESS_MEMBER_ID'];
$username=$_SESSION['user'];
$item_transaction = $_GET['tx'];
$amount = $_GET['amt'];
$status="Paid";
//select user and update money
$result = mysql_query("SELECT * FROM users WHERE uid='$uid'");
while($row = mysql_fetch_array($result)){
$money=$row["antu_money"];
mysql_query("UPDATE users SET antu_money=$money + $amount WHERE uid='$uid'");
}
//insert data into table because payment successful
$result = mysql_query("INSERT INTO antu_recharge(antu_email, antu_uid, antu_uname, antu_date, antu_trid, antu_amnt, antu_status) VALUES('$u_email', '$uid','$username', NOW(), '$item_transaction','$amount','$status')");
echo '<div id="login_content">';
echo '<div id="error_req">';
echo "<h1>Welcome, $username</h1>";
echo '<h1>Payment Successful</h1>';
echo "<meta http-equiv='refresh' content='5;url=recharge-history'>";
echo '</div>';
echo '</div>';
}
?>