This repository has been archived by the owner on Mar 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile.php
106 lines (81 loc) · 2.69 KB
/
profile.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
105
106
<?
include 'header.php';
include 'connect.php';
$eng_info = mysql_query("select * from users where Username = '".$_SESSION['Username']."'");
$row1333 = mysql_fetch_array($eng_info);
?>
<script>
jQuery(function(){
$("#submit").click(function(){
$(".error").hide();
var hasError = false;
var passwordVal = $("#Password").val();
var checkVal = $("#Password-check").val();
if (passwordVal == '') {
$("#Password").after('<span class="error">Please enter a password.</span>');
hasError = true;
} else if (checkVal == '') {
$("#Password-check").after('<span class="error">Please re-enter your password.</span>');
hasError = true;
} else if (passwordVal != checkVal ) {
$("#Password-check").after('<span class="error">Passwords do not match.</span>');
hasError = true;
}
if(hasError == true) {return false;}
});
});
// wait for the DOM to be loaded
$(document).ready(function() {
// bind 'myForm' and provide a simple callback function
$('#myForm').ajaxForm(function() {
Messenger().post({
message: 'Successfully Updated',
});
setTimeout(function() {
window.location.href = "index.php";
}, 2000);
});
});
</script>
<div class="container">
<div class="panel panel-default">
<div class="panel-body">
<form id="myForm" action="edit-user-password.php" method="post" class="form-horizontal">
<!-- Form Name -->
<!-- Form Name -->
<legend>Password Change</legend>
<div class="row">
<!-- Text input-->
<div class="col-sm-4">
<div class="control-group">
<label class="control-label" for="Password">New Password</label>
<div class="controls">
<input id="Password" name="Password" value="" placeholder="New Password" class="form-control input-lg" type="password">
</div>
</div>
</div>
<!-- Text input-->
<div class="col-sm-4">
<div class="control-group">
<label class="control-label" for="Password-check">Re-Type</label>
<div class="controls">
<input id="Password-check" name="Password-check" value="" placeholder="" class="form-control input-lg" type="password">
</div>
</div>
</div>
<!-- Text input-->
<div class="col-sm-4">
<div class="control-group">
<label class="control-label" for="submit"></label>
<div class="controls">
<button type="submit" id="submit" class="btn btn-primary btn-lg"><span class="glyphicon glyphicon-refresh"></span> Update Password</button>
</div>
</div>
</div>
</div>
</form>
</div>
</div>
</div>
<script src="js/bootstrap.js"></script>
<script src="js/bootstrap.min.js"></script>