forked from zonedoutspace/BitWallet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchangeaccount.php
More file actions
29 lines (25 loc) · 764 Bytes
/
changeaccount.php
File metadata and controls
29 lines (25 loc) · 764 Bytes
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
<?php
include("db.php");
if (isset($_POST['newpassword']) && isset($_POST['confirmnewpassword']))
{
$newpass = sha1($_POST['newpassword']);
$newpassconfirm = sha1($_POST['confirmnewpassword']);
$username = $_SESSION['username'];
//query
$password= sha1($_POST['currentpass']);
$sql = mysql_query("SELECT * FROM usersystem where username = '".$username."' AND password = '".$password."' LIMIT 1");
$rows = mysql_num_rows($sql);
if ($rows<=0)
{
die("Incorrect password");
}
if ($newpass != $newpassconfirm)
{
die ("new passwords do not match");
}
{
mysql_query("update usersystem SET password='$newpass' where username='$username'") or die (mysql_error());
header("Location: accountupdated.php");
}
}
?>