-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmail.php
36 lines (34 loc) · 956 Bytes
/
mail.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
<?php
include('include/connect.php');
if(isset($_POST['submit'])){
$emails=$_POST['email'];
$query="select * from customers where Email='$emails'";
$result=mysql_query($query) or die(error);
if(mysql_num_rows($result)){
$code=rand(100,999);
$new_pass = md5($code);
$emails=$_POST['email'];
mysql_query("update customers set Password='$new_pass' where Email='$emails'");
$subject = 'New Password';
$emails=$_POST['email'];
$email = htmlspecialchars($emails);
$message = "Good Day this is Jersey Developers Ltd. <br> Your Requested Password is".$code."<br>"."Don't forget to change your password!<br>"."Thank you!";
$to = htmlspecialchars($emails);
mail($to, $subject, $message);
?>
<script>
alert('Your New Password is Send to your Email');
window.location="index.php";
</script>
<?php
}
else
{
?>
<script>
alert('No user exist with this Email address');
window.location='forgotpass.php';</script>
<?php
}
}
?>