Changing the Redirect URL when deleting a record
I have an example which is slightly different to the regular situation, where a record would be deleted, and return to the the same page that lists the results.
The page I have is a details page, but the delete button is deleting a record in a joined table. The deletion is working, but I can't get it to redirect to the URL with the Itinerary ID.
So, for example, if the URL is:
http://www.goodsafariguide.net/itinerary_details/index_lodge5.php?ItineraryID=247
I have a look up table that pulls through Lodges that are part of the Itinerary. So I'm trying to get it to:
1. Delete a Lodge associated with the itinerary.
2. Return to the URL for the Itinerary.
By default the redirect URL line is:
$WA_redirectURL = "index_lodge5.php?ItineraryID=".((isset($_POST["WADADeleteRecordID"]))?$_POST["WADADeleteRecordID"]:"") ."";
But the DeleteRecordID is the LodgeID, not the ItineraryID.
So I've been trying to change it, I would have thought it should be something like:
$WA_redirectURL = "index_lodge5.php?ItineraryID=".$row_WADAItinerary_Lodges['ItineraryID'] ."";
But it keeps redirecting to:
http://www.goodsafariguide.net/itinerary_details/index_lodge5.php?ItineraryID=
rather than
http://www.goodsafariguide.net/itinerary_details/index_lodge5.php?ItineraryID=247
Hope that makes sense - I'm sure this must be something simple enough, but I can't for the life of me get it.
I've attached a copy of the page for reference.
Thanks.