Skip to content
World Wide Web Server edited this page Jul 4, 2012 · 3 revisions

Category:Libraries::Extended add the methods you think are useful [code] class MY_User_agent extends CI_User_agent { function MY_User_agent() { parent::CI_User_agent(); }

function is_xhr()
{
    if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) &&
         strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) == 'xmlhttprequest') 
    {
       return true;
    }
    else
    {
      return false;
    }
}

} [/code]

Clone this wiki locally