Prevent Public Access to CRON Job Scripts in CodeIgniter


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. 1.)
  2. $this->load->library('user_agent');
  3. if( $this->agent->is_browser() or $this->agent->is_robot() or $this->agent->is_mobile()):
  4. exit('You may not access this file.');
  5. endif;
  6.  
  7. 2.)
  8. if($this->session->userdata('ip_address') != $this->input->server('SERVER_ADDR')) { die(); }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.