Detect AJAX request in PHP

You can use this PHP code snippet to check if request is an AJAX request.


									<?php

if (!empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') {
	// Its AJAX request
}

?>
								

paterson23

Always ready to learn new things.

Comments (0)

No Comments Yet.