Last active
August 11, 2017 14:09
-
-
Save kroatoanweb/13226c93db987286dfaecc184bee01b7 to your computer and use it in GitHub Desktop.
Como detectar una petición ajax en PHP plano.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//Acciones que calculen el contenido | |
if(!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') { | |
//Mostramos el contenido en el formato especifico para las llamadas ajax | |
//Acabamos con un return o un die para evitar seguir ejecutando el codigo | |
} | |
//Mostramos el contenido en el formato normal | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment