Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $(function () {
- $('.error').hide();
- $(".form_submit").click(function () {
- $('.error').hide();
- var email = String($("input#email").val());
- //init ajax
- $.ajax({
- url: 'php/scripts/subscriber_exists.php',
- type: 'post',
- data: { email : email},
- error: function (xhr,error) {
- alert("xhr --> " + JSON.stringify(xhr) + " error --> " + JSON.stringify(error));
- console.log(xhr);
- console.log(error);
- },
- success: function (response) {
- var success = $.trim(String(response));
- if (success == 'false' ) {
- alert("Thank you so much!! --> [" + success + "]");
- } else
- alert("We understand your enthusiasm but you already are a subscriber! :D Thank you so much once again! [" + success + "]");
- }
- });
- //end ajax
- return false;
- });});
- include_once '../class/mariaConnection.php';
- include_once '../class/subscriber.php';
- $email = $_POST['email'];
- $maria = mariaConnection::getInstance();
- echo json_encode(($maria->existsEmail($email)) ? 'true' : 'false');
Add Comment
Please, Sign In to add comment