php CI ip限制
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‘);
郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。