5 * This page is for those users who have forgotten their
6 * password and want to have a new password generated for
7 * them and sent to the email address attached to their
8 * account in the database. The new password is not
9 * displayed on the website for security purposes.
11 * Note: If your server is not properly setup to send
12 * mail, then this page is essentially useless and it
13 * would be better to not even link to this page from
16 * Written by: Jpmaster77 a.k.a. The Grandmaster of C++ (GMC)
17 * Last Updated: August 26, 2004
19 include_once("include/session.php");
21 * Forgot Password form has been submitted and no errors
22 * were found with the form (the username is in the database)
24 if(isset($_SESSION['forgotpass'])){
26 * New password was generated for user and sent to user's
29 if($_SESSION['forgotpass']){
30 echo "<h2>New Password Generated</h2>";
31 echo "<p>Your new password has been generated "
32 ."and sent to the email <br>associated with your account. "
33 ."<a href=\"main.php\">Main</a>.</p>";
36 * Email could not be sent, therefore password was not
37 * edited in the database.
40 echo "<h2>New Password Failure</h2>";
41 echo "<p>There was an error sending you the "
42 ."email with the new password,<br> so your password has not been changed. "
43 ."<a href=\"main.php\">Main</a>.</p>";
46 unset($_SESSION['forgotpass']);
51 * Forgot password form is displayed, if error found
56 <h2
>Forgot Password
</h2
>
57 A
new password will be generated
for you
and sent to the email address
<br
>
58 associated with your account
, all you have to
do is enter your
60 <?
echo $form->error("user"); ?
>
61 <form action
="process.php" method
="POST">
62 <b
>Username
:</b
> <input type
="text" name
="user" maxlength
="30" value
="<? echo $form->value("user
"); ?>">
63 <input type
="hidden" name
="subforgot" value
="1">
64 <input type
="submit" value
="Get New Password">