Well, take a look at your code a little more closely. There's a couple problems.
First, your if() statement checks to see if the "bookingID" variable was sent as a GET parameter AND a POST parameter. Odds are it's only passed by one method. You should rewrite your code to only check the method that you expect the parameter to be passed by.
Second, you're trying to print the value passed by POST, but the rest of your code (including the SQL statement) uses the value passed by GET.
Let me be clear: These are two differente variables!
Finally, you should use $_GET and $_POST instead of $HTTP_GET_VARS and $HTTP_POST_VARS. The $HTTP_xxx_VARS versions were deprecated years ago.
Oh yeah, one more thing -- if your site allows the user to submit the bookingID via GET AND POST, then you need to rewrite your code to handle either. You can't handle both at the same time, since you're only cancelling one booking. To handle both would imply cancelling TWO bookings... get it?
Here's a suggestion:
if (isset($_GET['bookingID']))
{
$bookingID = $_GET['bookingID'];
}
else if (isset($_POST['bookingID']))
{
$bookingID = $_POST['bookingID'];
}
// now comes your original code,
// except we use $bookingID instead of $HTTP_xxx_VARS['bookingID']
if (isset($bookingID && !empty($bookingID))
{
$deleteSQL = ...
...
$deleteGoTo = "booking_cancelled.php?bookingID={$bookingID}" ;
...
}
Hope this helps!
}
Take care,
Nik
http://www.bigaction.org/