0
<?php
session_start();
echo 'POST: ';
print_r($_POST);
echo '<br />SESSION: ';
print_r($_SESSION);

require("DBconnect.php");
$user=$_SESSION['username'];
$pass=$_POST['password'];
echo $pass;
$salt = dechex(mt_rand(0, 2147483647)) . dechex(mt_rand(0, 2147483647)); 
$password = hash('sha256', $pass . $salt); 
for($round = 0; $round < 65536; $round++) 
{ 
    $p= hash('sha256', $password . $salt); 
}
echo $salt;
echo "....";
echo $p;
$qry="update users set password='$p' and salt='$salt' where username='$user'";
$result=mysql_query($qry);
if($result)
{

     echo "password updated successfully";

}
else
{
    die();
}

?>

***everything is working fine but in database it is not updating the values ,i am getting the values of user,salt,p still not updating if($result is also woking
***

2
Contributors
2
Replies
16
Views
4 Years
Discussion Span
Last Post by Shikha_1
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.