-
Notifications
You must be signed in to change notification settings - Fork 0
/
newpass.php
85 lines (85 loc) · 1.72 KB
/
newpass.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
<!-- 3/3 -->
<?php
session_start();
$useremail=$_SESSION['usermail'];
/*echo $umail;*/
include("connection.php");
?>
<style type="text/css">
*{
padding: 0;
margin: 0;
box-sizing: border-box;
}
.container{
background: #f2f2f2;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
}
.box{
background: #fff;
padding: 1.5em 2em;
box-shadow: 0 3px 7px rgba(0,0,0,.3);
}
.box h1{
text-decoration: underline red;
padding-bottom: .5em;
}
input{
padding: .5em;
}
.btn{
border: 2px solid black;
border-radius: 5px;
box-shadow: 0 3px 7px rgba(0,0,0,.3);
background: #f2f2f2;
padding: .5em 1em;
}
.btn:hover{
background: #000;
color: #fff;
}
</style>
<div class="container">
<div class="box">
<form method="POST">
<h1>New Password</h1>
New Password<br>
<input type="text" name="anykey" placeholder="Enter new password" required="required"><br><br>
<input class="btn" type="submit" name="confirm" value="Confirm">
</form>
<?php
if(isset($_POST['confirm']))
{
$newkey=$_POST['anykey'];
if($newkey!="")
{
$query="update employer set upass='$newkey' where uemail='$useremail'";
$data=mysqli_query($connect,$query);
if($data)
{
echo "<font color='green'>✔</font> successfully updated";
session_unset();
header('location:login.php');
}
else
{
echo "<font color='red'>✘ </font>failed to update";
session_unset();
header('location:login.php');
}
}
else
{
echo "<font color='red'>✘ </font>password can't be empty";
}
}
/*else
{
echo "not clicked";
}*/
?>
</div>
</div>