i want to be able to check if a user eamil exists on "blur()" with AJAX by posting the textbox data to php, i can see the data posted when i use firebug but i keep getting this error: Undefined index: data, i've tried so hard but haven't been able to resolve this issue yet. This is the javascript:

```
$(document).ready(function() {
$('#regEmail').blur(function() {
            var Email = $('#regEmail').val();
            var data = '{Email:' + Email + '}';
            $.ajax({
                type: "POST",
                url: "register.php",
                data: data,
                contentType: "application/json; charset=utf-8",
                dataType: "json",
                success: function (response) {
                    var result = response.exists;
                    if (result == true) {
                        alert('Email already exists!');
                        return;
                    }
                    else {
                        alert("Does not exist!");
                    }
                }
            });
        });
});

```

And this is the php code:

```
if (isset($_POST['data']))
    {
        $db = new mysqli("localhost", "xxxx", "xxxxxxx", "xxxxxxx");

        $data = $_POST['data'];
        json_decode($data);

        $Email = $data->fetch_assoc();
        $Email = $Email["Email"];

        $sql = "SELECT COUNT(*) as isExisting FROM users WHERE user_email='$Email'"; 
        $sql_result = $db->query($sql);
        $result = $sql_result->fetch_assoc();

        if ($result["isExisting"] > 0)
        {
            $response = json_encode(array('exists' => true));
        } else {
            $response = json_encode(array('exists' => false));
        }

        echo $response;
        print json_encode($_POST);
    }

```

I added "if (isset($\_POST['data']))" to check if the post data has been set but apparently it hasn't.