2 ////////////////////////////////////////////////////////////////////////////////
5 // Revision: $Revision: 1.1 $
6 // Description: Email's password to user who forgot
7 // Author: Andrew@DeFaria.com
8 // Created: Fri Nov 29 14:17:21 2002
9 // Modified: $Date: 2013/06/12 14:05:48 $
12 // (c) Copyright 2000-2006, Andrew@DeFaria.com, all rights reserved.
14 ////////////////////////////////////////////////////////////////////////////////
15 include "site-functions.php";
18 $next = (isset ($_GET [next])) ? $_GET[next] : 0;
19 $userid = $_REQUEST [userid];
25 // Get user information
26 $statement = "select * from user where userid=\"$userid\"";
28 $result = mysql_query ($statement)
29 or die ("emailpassword: SQL Query failed: " . $statement);
31 $row = mysql_fetch_array ($result);
34 $email = $row [email];
35 $password = $row [password];
36 $subject = "Your MAPS Password";
39 $statement = "select decode(\"$password\",\"$userid\")";
41 $result = mysql_query ($statement);
43 $row = mysql_fetch_array ($result, MYSQL_NUM);
45 $decoded_password = $row [0];
51 <title>Your MAPS Password</title>
54 <p>Your MAPS Password is $decoded_password</p>
56 <p>Click <a href=http://defaria.com/maps>here</a> to login to MAPS.
61 /* To send HTML mail, you can set the Content-type header. */
62 $headers = "MIME-Version: 1.0\r\n";
63 $headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
65 /* additional headers */
66 $headers .= "To: $email\r\n";
67 $headers .= "From: MAPS <MAPS@defaria.com>\r\n";
70 $mailed = mail($to, $subject, $message, $headers);
72 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
73 <html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
75 <title>MAPS: Password Retrieval</title>
81 <h2 class="header" align="center">
82 <font class="standout">MAPS</font> Password Retrieval</h2>
86 <?php NavigationBar ("")?>
88 <p>Your password has been emailed to <?php echo $email?></p>
90 <?php copyright (2001)?>