public function index() {
$ip = $this->input->ip_address();
if(!in_array($ip, $this->allowed_ips)){
$res = ‘access denied’;
echo ($ip);
echo ($res);
die();
}
$data[‘htmlData’] = ”;
$data[‘title’] = ”;
$data[‘description’] = ”;
$this->load->view(‘welcome_message’,$data);
}
application/config/config
$config[‘allowed_ips’] = array(‘127.0.0.1’, ‘192.168.113.2’,’112.64.175.190′,’103.242.170.38′,’101.68.66.2′,’203.94.14.53′,’123.30.238.14′,’119.81.21.170′,’192.168.23.1′,’180.173.80.209′,’180.173.84.111′,’203.74.199.3′, ‘192.168.0.144’);