I tested status.php return value with var_dump($result) and alerted it out in check() function like this:
function check() { $.ajax({
you just echo the $result like this
ajax not returning value so that we have to echo it.
and then should be like this
function check() { $.ajax({ url: "status.php" }).done(function(data) { if(data == "true"){ alert("true"); } else { alert("false"); } }); }