/ Published in: PHP
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
<?php define('IS_AJAX', isset($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest'); if(IS_AJAX) { echo 'Ajax request was here'; } else { echo 'Not ajax request'; } ?>