use jquery with ajax &
call ajax function onclick of submit button
$.ajax('URL', {
type: 'POST',
data: { myData: 'formdata' }, // data to submit
success: function (data) {
console.log(data);
}
});
2
solved Pass data from ajax in php