require_once 'layout-footerlg.php'; die; } if ($userinfoc['rkey'] == $_POST['crkey']) { // if the rkey is correct if ($npass != $rnpass) { // if new pass & repeat don't match require_once 'layout-headerlg.php'; echo "<h2>Passwords don't match. Try again. (click the link in the email again)</h2>"; require_once 'layout-footerlg.php'; die; } else { // everything is as expected, perform password reset $fpass->changepass($npass, $cuser); // update the user's password $polrauth->crkey($cuser); // update their reset token require_once 'layout-headerlg.php'; echo "<h2>Password changed.</h2>"; require_once 'layout-footerlg.php'; die; } } } $fpass = new fpass(); if (isset($_GET['key']) && isset($_GET['username'])) { $username = $mysqli->real_escape_string($_GET['username']); $userinfoc = $polrauth->getinfomu($username); if ($userinfoc == false) { echo "<h2>That username is not associated with any account. Please try again.</h2>" . "<br />" . "<a href='forgotpass.php'>Back</a>"; require_once 'layout-footerlg.php';