-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathchange_password.php
58 lines (52 loc) · 1.66 KB
/
change_password.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
<?php include('header.php'); ?>
<?php include('session.php'); ?>
<?php include('navbar.php'); ?>
<?php
$query=mysql_query("select * from students where student_id='$session_id'")or die(mysql_error());
$row=mysql_fetch_array($query);
?>
<div class="container">
<div class="margin-top">
<div class="row">
<?php include('head.php'); ?>
<div class="span3">
</div>
<div class="span7">
<form class="form-horizontal" method="post">
<div class="control-group">
<label class="control-label" for="inputEmail">New Password</label>
<div class="controls">
<input type="text" name="np" id="inputEmail" placeholder="New Password">
</div>
</div>
<div class="control-group">
<label class="control-label" for="inputPassword">Re-type Password</label>
<div class="controls">
<input type="password" name="rp" id="inputPassword" placeholder="Re-type Password">
</div>
</div>
<div class="control-group">
<div class="controls">
<button type="submit" name="update" class="btn btn-success">Update</button>
</div>
<br>
<br>
<?php
if (isset($_POST['update'])){
$np = $_POST['np'];
$rp = $_POST['rp'];
if($np!=$rp){
?>
<div class="alert alert-danger">Password Dont Match</div>
<?php
}else{
mysql_query("update students set password = '$np' where student_id = '$session_id' ")or die(mysql_error); ?>
<div class="alert alert-success">Password Change</div>
<?php }}?>
</div>
</form>
</div>
</div>
</div>
</div>
<?php include('footer.php') ?>