GetEmailFromName($userName); if($email){ $newPassword= Security::getNewPassword(); $hashedPassword=Security::hashPassword($newPassword); $db= new Database(FIDB_HOST,FIDB_NAME,FIDB_USER,FIDB_PASS); $sql= "UPDATE members SET UserPass ='$hashedPassword' WHERE Username = '$userName'"; $db->query($sql)->execute(); mail($email, "Your footyinsider.co.uk Account", "Your footyinsider password has now been reset.\n\nYour password is now '$newPassword' (without the quotes)\n\nHope that helps!, \n The footyinsider Team", 'From: Footy Insider '); $passwordSent= true; }else { // No such user $passwordSent= false; } } $template->header='Forgot Password'; $template->showsubscribe= false; if (isset($passwordSent)) $inner->passwordSent=$passwordSent; $inner->dummy='dummy'; $template->content=$inner; echo $template->fetch(); try { } catch (Exception $ex) { if (Authentication::get('ShowErrors')) { echo '

Error: '.$ex->getMessage().'

'; echo ''; echo ''; echo ""; echo ""; foreach($ex->getTrace() as $key=>$line) { echo ""; echo ""; echo ""; } echo '
FileLineFunction
-".$ex->getFile()."".$ex->getLine()."
$key".(isset($line['file'])?$line['file']:'-')."".(isset($line['line'])?$line['line']:'-')."".(isset($line['function'])?$line['function']:'-')."
'; } else { echo '

Error

'; echo '

Sorry, something has gone wrong. Support have been informed.

'; } } ?>