ajax response returns entire page
snippet in javascript

ajax response returns entire page

user4535

Use condition to verify if $_POST empty in you main page or index.php to not send the whole page in response ajax
and verif your AJAX URL
 $.ajax({
             type:"POST",
             url:"http://mywebsite.com/php/send_email.php",
   .......
   
index.php
------------------------
<?php 
if(empty($_POST)){ ?>

//
<html>
the header pages
the body
the include pages
the scripts pages
the footer
<?php } ?>