-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforgotPassword.php
More file actions
65 lines (54 loc) · 2.05 KB
/
Copy pathforgotPassword.php
File metadata and controls
65 lines (54 loc) · 2.05 KB
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
<?php
session_start();
$email_address = $_POST['email_address'];
if (!isset($_POST['email_address'])) {
?>
<form method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
<div class="input_box" id="div_forgotPwd"><input type="text" title="Please enter your email address" name="email_address" class="input"/>
<input type="submit" value="Submit" class="button"/></div>
</form>
<?php
}
elseif (empty($email_address)) {
echo $empty_fields_message;
}
else {
//include('config/config1.php');
mysql_connect("mavajsunco.netfirmsmysql.com", "alacut", "123456789") or die(mysql_error());
mysql_select_db("alacut")
or die(mysql_error());
$email_address = mysql_real_escape_string($email_address);
$status = "OK";
$msg="";
if (!stristr($email_address,"@") OR !stristr($email_address,"."))
{
$msg="<p>Your email address is not in the correct format.</p>Click <a class=\"two\" href=\"javascript:history.go(-1)\">here</a> to go back";
$status= "NOTOK";}
echo "";
if($status=="OK"){ $query="SELECT email,full_name FROM alacut_member WHERE alacut_member.email = '$email_address'";
$st=mysql_query($query);
$recs=mysql_num_rows($st);
$row=mysql_fetch_object($st);
$em=$row->email_address;// email is stored to a variable
if ($recs == 0) {
echo "<p>Sorry your address is not there in our database. Please try again.</p>Click <a class=\"two\" href=\"javascript:history.go(-1)\">here</a> to go back";
exit;
}
//$random_password = makeRandomPassword();
//$db_password = md5($random_password);
$db_password = mysql_query("SELECT password FROM `alacut_member` WHERE email='".$email_address."'");
$passwordInfo = mysql_fetch_array($db_password);
$password = $passwordInfo['password'];
$subject = "Your Password";
$message = "Hello, you have chosen to retrieve your password.
Your Password: ".$password."
http://www.alacut.com/test/script/index.php
Thanks!
Site admin
This is an automated response, please do not reply!";
mail($email_address, $subject, $message, "From: admin@alacut.com\n");
echo "<p>Your password has been send! Please check your email!";
}
else {echo "$msg";}
}
?>