$update=$conn->prepare("UPDATE ".$userTableName." SET
password=:password
WHEREusername=:username
");
// Bind parameters to query
$update->bindParam(":username",$username);
$update->bindParam(":password",$newPassword);
$update->execute();// Execute query
// Tell the user what we did
echo"<h3>Password successfully changed!</h3>";
echo"<p><a href=\"/user/".$_SESSION["username"]."\" onclick=\"redirect('this', '/user/".$username."')\">This link will take you back to your account</a></p>";
echo"<p>Or, you will be re-directed automatically in 5 seconds...</p>";
echo"<p>There was a problem and your password couldn't be updated. Make sure you've typed your old password correctly and try again</p>";
echo"<p><a href=\"/user/".$_SESSION["username"]."\" onclick=\"redirect('this', '/user/".$username."')\">This link will take you back to your account</a></p>";
echo"<p>Or, you will be re-directed automatically in 5 seconds...</p>";