I have a Login form where there are two fields - username and password.
I am using ajax to send this variables to login.php which works.
Now I need to get the data back from login.php so I do this:
$.post('login.php',{username:username,password:password},
function(data)
{
$('#data').html(data);
if (data=='login'){
window.location="http://www.google.co.uk";
}
});
The problem is the code should redirect to http://www.google.co.uk
if only the data is == loginBut it doesnt. please help thanks!