I send some data to the server using ajax and I receive 2 variables, success and error, depending on if the mail was sent or not. How do I listen to them with ajax and how do I alert them and is the php code correct?
php code:
if ($send){
echo json_encode($success);
} else { echo json_encode($error);
}
You can do this in a such way