According to PayPal, the item_number, hidden input value, is returned back to the return_URL upon successful payment but I haven't found a way to determine what's being returned back if any values at all.
When the value is returned back it indicates the row number. I want find the row in a MySQL table and update the value in the STATUS column from "InActive" to "Active" based on the record id provided back to the successpayment.php URL.
Here's my code in a file named paymentsuccess.php:
<?php
$id = $HTTP_GET_VARS['id'];
// First, check to make sure $id is numeric ... just in case :
if (is_numeric($id)) {
include("settings.inc");
mysql_select_db($mydb, $connection);
// Create a query and pay special attention to the
// WHERE id = '$id' as it selects only the data with
// this given id which is what is wanted here
$result = "UPDATE mytable SET STATUS='Active' WHERE ID='$id'";
$r = mysql_query($result) or die("Error with Query");
}else{
echo("<tr><td>Record ID Not Numeric</td></tr>");
}
?>
I tried changing the variable in the $id = $HTTP_GET_VARS['id']; from id to item_number but that didn't work either.
Any thoughts about how to retrieve the item_number pass thru variable would be appreciated.
Thanks.
Bill.