1 <?php
include "config.php";
4 echo '<form method=post action=forgotpass.php>
5 Your Email: <input type=text name=email><br>
6 <br><input type=submit name=submit value="Resend your Password">
13 echo 'You must enter an email address.<br><br>
14 <form method=post action=forgotpass.php>
15 Your Email: <input type=text name=email><br>
16 <br><input type=submit name=submit value="Resend your Password">
20 $sql = "SELECT * FROM users WHERE email='$email'";
21 $result = mysql_query($sql);
22 if (mysql_num_rows($result) == 0)
24 echo "This email address has not been found in the database.";
27 $myrow = mysql_fetch_array($result);
28 $datedate = date("n/j/y g:i:s A");
29 $mailsubject = "Your forgotten password for GameFAQs Hell.";
30 $mailbody = "Your Username: ".$myrow["username"]."\nYour Password: ".$myrow["userpass"]."\n\nThis request was made at ".$datedate." from the IP ".$REMOTE_ADDR;
31 if (mail($email, $mailsubject, $mailbody))
32 echo "Your password has been sent to the email address you provided.";
34 echo "Failed to resend your password.";