-
Notifications
You must be signed in to change notification settings - Fork 1
/
changePass.php
104 lines (91 loc) · 2.04 KB
/
changePass.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
94
95
96
97
98
99
100
101
102
103
104
<?php
include("configASL.php");
session_start();
if(!isset($_SESSION['aid']))
{
header("location:index.php");
}
$aid=$_SESSION['aid'];
$x=mysqli_query($al,"select * from admin where aid='$aid'");
$y=mysqli_fetch_array($x);
$name=$y['name'];
$old=$y['password'];
if(!empty($_POST))
{
$p1=sha1($_POST['p1']);
$p2=sha1($_POST['p2']);
if($old==$p1)
{
$u=mysqli_query($al,"update admin set password='$p2' where aid='$aid'");
}
if($u==true)
{
?>
<script type="application/javascript">
alert('Successfully changed password');
</script>
<?php } else { ?> <script type="application/javascript">
alert('Incorrect old password');
</script><?php }
}
?>
<!doctype html>
<html><!-- Designed & Developed by Ashish Labade (Tech Vegan) www.ashishvegan.com | Not for Commercial Use-->
<head>
<meta charset="utf-8">
<title>Student Feedback System</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="topHeader">
TECH VEGAN PROJECTS<br />
<span class="tag">STUDENT FEEDBACK SYSTEM</span>
</div>
<br>
<br>
<br>
<br>
<div id="content" align="center">
<br>
<br>
<span class="SubHead">Change Password</span>
<br>
<br>
<form method="post" action="" >
<div id="table">
<div class="tr">
<div class="td">
<label>Old Password : </label>
</div>
<div class="td">
<input type="password" name="p1" size="25" required placeholder="Enter Old Password" />
</div>
</div>
<div class="tr">
<div class="td">
<label>New Password : </label>
</div>
<div class="td">
<input type="password" name="p2" size="25" required placeholder="Enter New Password" />
</div>
</div>
</div>
<div class="tdd">
<input type="submit" value="CHANGE PASSWORD" />
</div>
<br>
<br>
<br>
<input type="button" onClick="window.location='home.php'" value="BACK">
<br>
<br>
</div>
</form>
<br>
<br>
<br>
<br>
<br>
</div>
</body>
</html>