<?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
***