forked from codeb1ooded/RTI_Automation
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathforgot.php
More file actions
62 lines (61 loc) · 1.2 KB
/
forgot.php
File metadata and controls
62 lines (61 loc) · 1.2 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
<html>
<head>
<style type="text/css">
input{
border:1px solid olive;
border-radius:5px;
}
h1{
color:darkgreen;
font-size:22px;
text-align:center;
}
</style>
</head>
<body>
<h1>Forgot Password<h1>
<form action='#' method='post'>
<table cellspacing='5' align='center'>
<tr>
<td>Email id:</td>
<td><input type='text' name='mail'/></td>
</tr>
<tr>
<td></td>
<td><input type='submit' name='submit' value='Submit'/></td>
</tr>
</table>
</form>
<?php
if(isset($_POST['submit']))
{
mysql_connect('localhost','root','') or die(mysql_error());
mysql_select_db('rti') or die(mysql_error());
$mail=$_POST['mail'];
$q=mysql_query("select * from login where email='".$mail."' ") or die(mysql_error());
$p=mysql_affected_rows();
if($p!=0)
{
$res=mysql_fetch_array($q);
$to=$res['email'];
$subject='Remind password';
$message='Your password : '.$res['password'];
$headers='From:ugbakwaas@gmail.com';
$m=mail($to,$subject,$message,$headers);
if($m)
{
echo 'Check your inbox in mail';
}
else
{
echo 'mail is not send';
}
}
else
{
echo'You entered mail id is not present';
}
}
?>
</body>
</html>