EMailing a Shopper's Forgotten Password

 

Introduction.  We can't always expect a shopper to remember their password.  But we can hope that if they can remember their email address and type it then we can email their password to them.  This page is a simple form to take a shopper's email address and then process it so their password is emailed.

The following code should be called email_password.php and it needs to be uploaded to your firefox web.  This page will be the form for obtaining the email address.

 

<html>
<!-- email_password.php - using an email address to have the password mailed -->
<head>
<title>EMail Password</title>
</head>
<?php
include("includes/header.php");
include("includes/connection_config.php");
?>

<p>&nbsp;</p>
<p>&nbsp;</p>
<div align="center">
<table border="0" cellpadding="3" cellspacing="0" align="center" width="400" id="layout_table">
<tr>
<td width="400" align="center"><b><font size="4" color="#999966">Please Enter Your EMail Address<br>
and We Will Email Your Password<br></font></b></td>
</tr>
<tr>
<td width="400">
<form method="POST" action="email_password_process.php">
<div align="center">
<table border="0" cellpadding="5" cellspacing="0" width="400" id="table_access">
<tr>
<td width="100" align=right><b><font size="4">E-Mail:</font></b></td>
<td width="300">
<input type="text" name="txt_original_email" size="30" style="font-size: 14pt"></td>
</tr>
<tr>
<td colspan="2" align="center">
<input type="submit" value="Submit" name="cmd_email_password" style="font-size: 14pt; font-weight: bold"></td>
</tr>
</table>
</div>
</form>
</td>
</table>
</div>
</body>
</html>
 
The following is an image of what the webpage looks like.

 

 

The processing script should be called email_password_process.php.  This code needs to do the following.
  • obtain the email address entered on email_password.php
  • open a connection to the database
  • query the profile table to find the email address
    • if it finds the email address it should
      • email the password with very little additional info except who is emailing it
    • if it doesn't the processing script should notify the user on the email_password.php page

This will likely be left as a homework problem in Homework 3.