From The Blog

PHP: check whether an AJAX request

5 June 2013, in

if ( !empty($_SERVER['HTTP_X_REQUESTED_WITH']) && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest' ) {

 

//if ajax request your code runs here

}

else{

//if not an ajax request your code runs here

}



Post a Comment

CakePHP 2 aggressive Security - continued

29 February 2012, in

CakePHP 2.0 has another aggressive security which is shown clearly when trying to make an ajax request to an action via method POST, it fires security error that says "Request is blackholed due to auth".

The Solution to disable this aggressive validation for this action to set security attribute $validatePost to false.

 



Post a Comment