-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.php
More file actions
executable file
·68 lines (62 loc) · 1.93 KB
/
Copy pathsettings.php
File metadata and controls
executable file
·68 lines (62 loc) · 1.93 KB
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
<?php
session_start();
if (!isset($_SESSION['user']))
{
header("Location: login.php");
}
include ('config.php');
if ($_POST['Submit']=='Change')
{
$rsPwd = mysql_query("select user_pwd from users where user_name='$_SESSION[user]'") or die(mysql_error());
list ($oldpwd) = mysql_fetch_row($rsPwd);
if ($oldpwd == md5($_POST['oldpwd']))
{
$newpasswd = md5($_POST['newpwd']);
mysql_query("Update users
SET user_pwd = '$newpasswd'
WHERE user_name = '$_SESSION[user]'
") or die(mysql_error());
header("Location: settings.php?msg=Password updated...");
} else
{ header("Location: settings.php?msg=ERROR: Password does not match..."); }
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
<title>Change Password</title>
<link type="text/css" href="css/jquery-ui.custom.css" rel="stylesheet" >
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/jquery-ui.custom.min.js"></script>
<script type="text/javascript">
$(function(){
$("#button-3").button();
$("#button-4").button();
});
</script>
<style type="text/css"> /*demo page css*/
body{ font: 62.5% "Trebuchet MS", sans-serif;}
</style>
</head>
<body>
<div class="ui-state-default ui-widget">
<p>
<?php if (isset($_GET['msg'])) { echo "<div class=\"msg\"> $_GET[msg] </div>"; } ?>
</p>
<h2>Change Password</h2>
<form action="settings.php" method="post" name="form3" id="form3">
<p>Old Password
<input name="oldpwd" type="password" >
</p>
<p>New Password:
<input name="newpwd" type="password" >
</p>
<p>
<input name="Submit" type="submit" id="button-3" value="Change">
<input type="button" value="Close" onclick="self.close()" id="button-4">
</p>
</form>
</div>
</body>
</html>