I\'m new to web development.
Right now I\'m working on a login feature on a site. I used Javascript/AJAX to fetch the username and password and send it to a PHP file for
You can one thing replace your code header("Location: profile.php"); by echo "window.location.href='profile.php'; and replace your success function as
header("Location: profile.php");
echo "window.location.href='profile.php';
if(obj.status == 200) { eval(obj.responseText); }
Thats it. now a response will be evaluated by script and will redirect your page on profile.php