i have a function
function chkLogin() {
$.get("setAlert.php", function (data) {
$(".result").html(data);
if (data == 'Not logged in') {
alert("not logged in.");
} else {
alert("success");
}
});
}
setAlert.php
if (!isset($login_session)) {
return "Not logged in";
}
else{
return "logged in";
}
and it alerts success because data is blank. So how can i set data to "Logged in " or "Not logged in" ? Please help.