How do I check if the request is an AJAX? I am using CodeIgniter. I have a link that when it clicked, it\'ll open the pop-up dialog window this is done through ajax it reque
Codeigniter has inbuilt function to check if the request is made using Ajax call.
You can use the following way to validate if a controller/segment is called using Ajax or not.
input->is_ajax_request()){
show_404();
}
}
}
You can use many other checks as well using input class.
Few of them are
$this->input->get_request_header();$this->input->is_cli_request()$this->input->ip_address()You can view complete list of available methods at Official documentation