# This will generate a new password if user has forgotton password

<?php
/***************************************************************************
 *			forgot.php                   	                   *
 *                     	          				           *
 *   File Info:		  Forgot password                                  *
 *   Copyright:       Copyright 2003 http://www.128concepts.com            *
 *						                           *
 ***************************************************************************/
include ("./tests.php");
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<TITLE>Generate temporary user password</TITLE>
</HEAD>
<BODY>
<?php
include("./config.php");
include("./your-header.inc");
######################### if first time...url will contain PHPSESSID=xxxx         #############################
######################### code below will refresh page to remove PHPSESSID #############################
$strvar = getenv("QUERY_STRING");
$pos = strpos($strvar,'=');
if ($pos > 0)
{
if ($noshow == "YES")
{
echo "<br><center><table width=450 border=1 cellspacing=0 cellpadding=0 height=150>
<tr><td width=450 bgcolor=#CCCCCC height=10>$header</td></tr>
<tr><td width=450 bgcolor=#FFFFFF height=140>";
	echo "<b><br><center>Please be patient as we now re-directing you to main store page...<br>You will only see this message once i.e every time you start a new browser window.</center></b><br></td></tr></table></center>";
	include("./your-footer.inc");
}
	include_once("./redirect-me.php");
} else {
echo "
<h2><center><img src=images/searchs1.gif border=0><font face =Verdana size = 3 color = navy>Generate a temporary user password</font></center></h2><img src=images/line.gif border=0 width=100% height=1>
<font face = Verdana size = 2><p align = justify>This page will permit you to generate a new temporary password
in the event you forgotton your password. You are provided with two methods for you to remember or generate
a new temporary password. If you  select the first method, you must provide us with your username and we
will print on screen, your user's password hint to help you remember.</p></font>
<br><font face = Verdana size = 2><p align = justify>The second method we require you to provide us, your
username and email. A new temporary password will be generated and sent to your email address. This is a
temporary password and the user is strongly advised to change the password immediately.</p></font>";

echo"
<br><font face = Verdana size=2><b>Method 1 and 2:</b></font>
<div align=\"center\">
  <form method=\"post\" enctype=\"multipart/form-data\" action=\"forgot1.php\">
    <table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\">
      <tr> 
        <td colspan=\"2\" width=\"400\" height=\"10\"> <b>Lost your password?</b></td>
      </tr>
      <tr> 
        <td colspan=\"2\" width=\"400\" height=\"10\">This method will display your user' hint to help you remember your password!</td>
      </tr>
      <tr> 
        <td width=\"100\" height=\"10\">Your username:</td>
        <td height=\"10\" width=\"300\"> 
          <input type=\"text\" class=\"textbox\" name=\"username\">
        </td>
      </tr>
      <tr> 
        <td width=\"100\" height=\"10\"></td>
        <td height=\"10\" width=\"300\"> 
          <input type=\"submit\" name=\"submit\" class=\"submit\" value=\"Send Password\">
        </td>
      </tr>
      <tr> 
        <td colspan=\"2\" height=\"10\"> 
        </td>
      </tr>
    </table>
  </form>
<br></div>
<div align=\"center\">
  <form method=\"post\" enctype=\"multipart/form-data\" action=\"forgot2.php\">
    <table border=\"0\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\">
      <tr> 
        <td colspan=\"2\" width=\"400\" height=\"10\"> <b>Lost your password?</b></td>
      </tr>
      <tr> 
        <td colspan=\"2\" width=\"400\" height=\"10\">This method will generate you a temporary password. It is strongly recommended you update your temporary password once you receive the email.</td>
      </tr>
      <tr> 
        <td width=\"100\" height=\"10\">Your username:</td>
        <td height=\"10\" width=\"300\"> 
          <input type=\"text\" class=\"textbox\" name=\"username\">
        </td>
      </tr>
    <tr> 
        <td width=\"100\" height=\"10\">Email address:</td>
        <td height=\"10\" width=\"300\"> 
          <input type=\"text\" class=\"textbox\" name=\"email\">
        </td>
      </tr>
      <tr> 
        <td width=\"100\" height=\"10\"></td>
        <td height=\"10\" width=\"300\"> 
          <input type=\"submit\" name=\"submit\" class=\"submit\" value=\"Send Password\">
        </td>
      </tr>
      <tr> 
        <td colspan=\"2\" height=\"10\"> 
        </td>
      </tr>
    </table>
  </form>
</div>";
include("./your-footer.inc");}
?>

</BODY>
</HTML>