Posted By

traeregan on 11/29/09


Tagged

cron codeigniter


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

ncho
dantreacy


Prevent Public Access to CRON Job Scripts in CodeIgniter


 / Published in: PHP
 

  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  

You need to login to post a comment.