As xav0989 wrote, always state the error message. If you mean you're getting redirected to "settings.php?uspjeh", then you know what's happening: the if ($user_name == ($_SESSION['user'])) test is failing. (Minor issue: the parentheses around $_SESSION['user'] in the test are unnecessary and...