I have a similar situation with login processing. To keep it short ... I get a PDT, IPN, and everyone sends me an email. The letter is sent to the client via IPN VERIFIED to provide the serial number and password to the client. Since PDT and IPN I use goto to send me an electronic journal, not a bunch of consecutive ifs. After reading a lot of answers, I studied each to understand what would suit my Issu. I finally used ...
<?php ignore_user_abort(TRUE);
Since I worked with progressive checks (no ifs), if they were unsuccessful, I use for example ...
$mcalmsg .= "Check [serialnbr]\r\n"; if (empty($_POST['serialnbr'])) { header('Location: '.$returnurl.'?error=1'); $mcalmsg .= "Missing [serialnbr]\r\n"; goto mcal_email; // Last process at end of script } else {$serialnbr=strtoupper(htmlspecialchars(trim($_POST['serialnbr']))); $mcalmsg .= "[serialnbr]=$serialnbr\r\n"; }
This (for now) works just as necessary. Of course, the script has more, but follows the same concept. Where this location is indicated, there are also 3 information pages, each of which can be dropped using the same concept.
mcal_email: //last process before ending, always gets here after all else from goto or clearing all checks. // compose email and send ?> // end of script
source share