Answers for "is ajax request php"

PHP
2

check if ajax request php

if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
	/* special ajax here */
	die($content);
}
Posted by: Guest on August-31-2020
-2

ajax call php

$.ajax({ url: '/my/site',
         data: {action: 'test'},
         type: 'post',
         success: function(output) {
                      alert(output);
                  }
});
Posted by: Guest on December-09-2020

Browse Popular Code Answers by Language