You are looking for the last time that the $WA_redirectURL is set:
$WA_redirectURL = "yourdesiredpage.php";
if you are performing an insert or update and emailing the information, or you are sending multiple emails or using other behaviours you may have more than one opportunity in the code for the $WA_redirectURL to be set, if so, you want the LAST behaviour to set that variable for you, leave the others blank.
$WA_redirectURL = "";