// reset the code. unset($_SESSION['correctcode']);
if ($forward == 1) { header ("Location:$location"); } else { include "/home/me/header.php"; echo "<p class="title">Thanks!</p>n<p>Blah blah blah .. your ID for this submission is: <strong>[ID:" . $id . "]</strong>.</p>n"; include "/home/me/footer.php"; } }[/code]
Validate, but instead of going on and emailing immediately, refresh the page with the form, have them click Accept or Cancel, and then go to the mail part ?
In the first form, add a hidden field with name='form1' value='herewego'
in the script: [code=php] if(!isset($_POST['form1']) { //echo the form or message saying they have to register via the form } if((isset($_POST['form1']) AND ($_POST['form1'] == "herewego")) { //Validate the registrant's info //At the end of validation, put $msg into the session as $_SESSION['msg'] } if((!isset($accepted)) AND (isset($_POST['form1']) AND ($_POST['form1'] == "herewego")) { echo "The form will be sent using the following information.<br>"; print("<form action='".$_SERVER[PHP_SELF]."'>n <input type='text' name='NAME' disabled value='".$_POST['NAME']."'><br>n etc etc... <input type='hidden' name='form1' disabled value='herewego'>n <input type='hidden' name='unid' disabled value='".$id."'>n <input type='submit' name='accepted' value='Accept Values'>n <input type='submit' name='no' value='Cancel Registration'>n </form>n "); $mail = false; } if((isset($accepted)) AND (isset($_POST['form1']) AND ($_POST['form1'] == "herewego")) { $mail = true } if((isset($no)) AND (isset($_POST['form1']) AND ($_POST['form1'] == "herewego")) { //canceled registration code here $mail = false } if($mail === true) { $msg = $_SESSION['msg']; $fh = fopen("/home/me/count.txt","r"); $id = fread($fh, filesize("/home/me/count.txt")); fclose($fh);
// reset the code. unset($_SESSION['correctcode']);
if ($forward == 1) { header ("Location:$location"); } else { include "/home/me/header.php"; echo "<p class="title">Thanks!</p>n<p>Blah blah blah .. your ID for this submission is: <strong>[ID:" . $id . "]</strong>.</p>n"; include "/home/me/footer.php"; } }[/code]