'; ?> getVerification(\Models\Verification::TYPE_EMAIL); } try { switch ($action) { case 'deliver': if (is_post()) { \App\Content::verifyPost(); // $email = $_user->email; $email = get('email', $_POST); $verification = $_user->createVerification(\Models\Verification::TYPE_EMAIL, $email, \Models\Verification::METHOD_EMAIL); try { $delivered = $verification->deliver(); if ($delivered) { // redirect i.e. refresh the page redirect(APP_URL.'/php_security_email_verify.php'); } else { $verification = null; throw new Exception('Failed to deliver the verification email!'); } } catch (Exception $ex) { $verification = null; throw $ex; } } break; case 'reset': // delete the old verification if ($verification) { $verification->delete(); $verification = null; } break; case 'validate': $key = get('key'); // in production, the following code instead // $_user->verifyEmail($key); if ($key && $verification && $verification->validate($_user)) { $verified = $verification->verify($key); if ($verified) { // redirect to somewhere for a successful verification redirect(APP_URL.'/php_security_email_verify.php?verified=1'); } else { throw new Exception('Invalid verification link'); } } else { throw new Exception('Invalid verification link'); } break; } } catch (Exception $ex) { $exception = $ex->getMessage(); $defaults = $_POST; $verification = null; } ?>
Verification Success!
Your verificaton link is valid. Good job!', 'success') : null ?>

Thank you! Please check your email.

For demo purposes, enter the email you want to receive the confirmation.

true]); $input->type('email') ->label('Enter Email Address') ->value(get('email', $defaults)) ->placeholder('youremail@domain.com') ->attr(['autofocus']) ->printHtml(); ?>
Not authenticated
Redirecting in 5 seconds...', 'danger') ?>
2020 © SmartAdmin for PHP by @lodev09