I have setup cronjob in codeigniter. Cron job is working fine but i wanna restrict direct access to cron url.
I have tried below code but it was not working.
if (isset($_SERVER['REMOTE_ADDR'])) die('Called from Browser');
$_SERVER['PATH_INFO'] = $_SERVER['REQUEST_URI'] = '/cron/cron_alert'; // Setting the path of controller/method
include(dirname(dirname(__FILE__)).'/index.php'); //Now just call the framework
Thanks in advance.