-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path20.fac_forgot_pass.php
93 lines (92 loc) · 2.66 KB
/
20.fac_forgot_pass.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
<?php
session_start();
if (isset($_POST['submit'])){
include("0.conn.php");
$fac_no=$_POST['fac_id'];
$query="SELECT `Uname` FROM `fac_details` WHERE `fid`=$fac_no";
$result=mysqli_query($conn,$query);
if(mysqli_num_rows($result)==1)
{
$_SESSION['fac_id']=$fac_no;
$sql="SELECT `Email` FROM `fac_details` WHERE `fid`=$fac_no";
$query=mysqli_query($conn,$sql);
$result=mysqli_fetch_assoc($query);
$mail=$result['Email'];
$otp=mt_rand(100000, 999999);
$_SESSION["fac_otp"]=$otp;
$sub="OTP verification";
$msg="Your otp is: $otp";
mail($mail, $sub, $msg);
header("Location:21.fac_otp.php");
}
else{
echo '<script>alert("Invalid Faculty ID")</script>';
}
}
?>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width initial-scale=1.0">
<title>Forgot password</title>
<style>
body{
margin:0px;
padding:0px;
font-family: monospace;
background: linear-gradient(120deg,#2980b9,#8e44ad);
overflow: hiddden;
}
.center{
position: absolute;
top:50%;
left:50%;
transform:translate(-50%,-50%);
width: 400px;
height:270px;
background: white;
border-radius: 10px;
}
.center h1{
text-align: center;
padding: 0 0 20px 0;
border-bottom: 1px solid silver;
}
.center form{
padding: 0 40px;
box-sizing: border-box;
}
form .txt_field{
position: relative;
margin:50px 0;
}
.txt_field input{
margin-left: 70px;
padding:10px;
border:1px solid black;
border-radius:5px;
}
.sub button{
margin-left: 125px;
padding: 8px;
margin-top: -20px;
width:70px;
border:1px solid black;
border-radius:5px;
}
</style>
</head>
<body>
<div class="center">
<h1>Forgot Password</h1>
<form method="POST" action="20.fac_forgot_pass.php">
<div class="txt_field">
<input type="text" name="fac_id" required placeholder="Enter Faculty ID">
</div>
<div class="sub">
<button type="submit" name="submit">Submit</button>
</div>
</form>
</div>
</body>
</html>