. **/ try{ if(isset($_POST['password']) && isset($_POST['password_confirm'])){ if($_POST['password']!=$_POST['password_confirm']){ functions::setError(10); } else{ $sql=$db->prepare("UPDATE users SET password=:passwd WHERE id=:id"); $sql->execute(array(":passwd"=>PasswordStorage::create_hash($_POST['password']), ":id"=>$_SESSION['id'])); $res=$sql->rowCount(); if($res>0){ functions::setMessage(6); } else{ functions::setError(4); } } } } catch(Exception $e){ functions::setError(500); error_log($e); }