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'])]); try { $verification = new Email(); $verification->addTo(NOTIFICATION_TO); $verification->setFrom(SMTP_FROMADDRESS, SMTP_FROMNAME); $verification->setSMTP(SMTP_HOST, SMTP_PORT, SMTP_AUTH, SMTP_USERNAME, SMTP_PASSWORD, SMTP_SECURITY); $verification->setSubject("HACHE email verification"); $verification->setBody("The verification code for renewing your HACHE membership is $code."); $verification->send(); } catch (Exception $e) { } } 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.