Prevent Public Access to CRON Job Scripts in CodeIgniter
Copy this code and paste it in your HTML
1.)
$this->load->library('user_agent');
if( $this->agent->is_browser() or $this->agent->is_robot() or $this->agent->is_mobile()):
exit('You may not access this file.');
endif;
2.)
if($this->session->userdata('ip_address') != $this->input->server('SERVER_ADDR')) { die();
}
Report this snippet