I have this code
$.ajax({
type: 'POST',
url: 'ajaxfunctions.php',
data: {email: email},
success: function(data)
{
if(data == "true" || data == "false")
{
alert("Response")
}
else
alert("Data: " + data);
}
});
with this PHP-Script
if(isset($_POST['email']))
{
$email = $_POST['email'];
$countEmail = $db->getCountEmail($email);
if($countEmail == 1)
echo "true";
else {
echo "false";
}
}
The problem is, that it never comes in the alert("Response") case. Always in the other. In the alert window I then got my full index.html content.. What am I doing wrong?