Whenever I try to add email on mysql server. My page is not responding. why?

I am a little bit confused. see the code below.

$('#submit').click(function() {
    $('#showdata').html($('#senddata').serialize()); /*Print all data that passed from form.*/
    $.ajax({
        url: "save.php",
        /* Here data store on mysql server without email and response to welcome.php. */
        type: "POST",
        /* if i want to add proper email format then data store in mysql but not response on welcome.php. */
        data: $('#senddata').serialize(),
        success: function(r) {
            alert("ok");
            $('#senddata').trigger('reset');
            window.location = 'welcome.php'; /*This is welcome page*/
        }
    })
})

I want to submit a form using the ajax post method. If I write any name instead of email then data is stored on the server and responding welcome.php. Whenever I write any name email then data is stored on the server but responding welcome.php. Here is 'save.php' code.

<?php
include('./config.php');
print_r($_POST);
    $name=$_POST['name'];
    $email=mysqli_real_escape_string($con,$_POST['email']);
    $pwd=$_POST['password'];
    $vill=$_POST['address'].$_POST['city'].$_POST['state'].$_POST['zip'];
    $insertdata="INSERT INTO `persons`(`name`,`email`,`pwd`,`vill`)VALUE('$name','$email','$pwd','$vill')";
    print_r($insertdata);
    if(mysqli_query($con,$insertdata)){
        echo "data added";
    }else{
        echo "not added";
    }

?>

Note: if I put my button <button class="btn btn-primary" id="submit">sign up</button> outside form then everting is right.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum