forked from GiovanniV/CRM-Contact-Manager
/
password.php
68 lines (61 loc) · 2.41 KB
/
password.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<?php require_once('includes/config.php');
include('includes/functions.php');
mysql_select_db($database_contacts, $contacts);
$pagetitle = "Password Request";
session_start();
if ($_POST['email']) {
record_set('passwordcheck',"SELECT * FROM users WHERE user_email = '".$_POST['email']."'");
if ($totalRows_passwordcheck==1) {
//SEND EMAIL WITH PASSWORD
$password = $row_passwordcheck['user_password'];
$emailfrom = $row_passwordcheck['user_email'];
$name = "Simple Customer";
$subject = "Your Password";
$message = "Your password is $password.";
$emailto = $row_passwordcheck['user_email'];
mail($emailto, $subject, $message,
"From: $name <$emailfrom>\n" .
"MIME-Version: 1.0\n" .
"Content-type: text/html; charset=iso-8859-1") .
redirect('Your password has been sent.',"login.php");
//END SEND EMAIL
}
if ($totalRows_passwordcheck < 1) {
set_msg('That email address was not found in the database.');
header('Location: password.php'); die;
}
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><?php echo $pagetitle; ?></title>
<script src="includes/lib/prototype.js" type="text/javascript"></script>
<script src="includes/src/effects.js" type="text/javascript"></script>
<script src="includes/validation.js" type="text/javascript"></script>
<script src="includes/src/scriptaculous.js" type="text/javascript"></script>
<link href="includes/style.css" rel="stylesheet" type="text/css" />
<link href="includes/layout.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="logincontainer">
<h1>Simple Customer </h1>
<span class="notices" style="display:<?php echo $dis; ?>">
<?php display_msg(); ?>
</span>
<form id="form1" name="form1" method="post" action="">Enter your email address below and your password will be sent to you immediately. <br />
<br />
<input name="email" class="required validate-email" type="text" size="35" title="You must enter your email address." />
<br />
<input type="submit" name="Submit" value="Send Password" />
<a href="password.php"></a> </p>
<p> </p>
<p><a href="login.php">Go back </a></p>
</form>
<script type="text/javascript">
var valid2 = new Validation('form1', {useTitles:true});
</script>
</div>
</body>
</html>