has("families", ['email' => strtolower($_POST['email'])])) { header("Location: ./?page=renew&msg=noemail"); die("We don't have that email on file for any current families."); } $code = mt_rand(100000, 999999); $_SESSION['code'] = $code; $_SESSION['maybefamily'] = $database->get('families', 'familyid', ['email' => strtolower($_POST['email'])]); // TODO: send email file_put_contents("/var/www/html/code.txt", $code); } else if (!empty($_POST['code'])) { if (empty($_SESSION['code'])) { header("Location: ./?page=renew&msg=sessionexpired"); die("You took too long and were automatically logged out. Please try again."); } if (preg_replace("/[^0-9]/", "", $_POST['code']) == $_SESSION['code']) { $_SESSION['familyid'] = $_SESSION['maybefamily']; header("Location: ./?page=signup"); die("You are verified, go to ./?page=signup"); } $badcode = true; } else { header("Location: ./?page=renew&msg=bademail"); die("That email address doesn't look right. Please try again."); } ?>
Enter the code from the email we just sent you. If you didn't get it, check your spam or junk folder.