ip_address()
Returns: | Visitor’s IP address or ‘0.0.0.0’ if not valid |
---|---|
Return type: | string |
Returns the IP address for the current user. If the IP address is not valid, the method will return ‘0.0.0.0’:
echo $this->input->ip_address();
Important
This method takes into account the $config['proxy_ips']
setting and will return the reported HTTP_X_FORWARDED_FOR, HTTP_CLIENT_IP, HTTP_X_CLIENT_IP or HTTP_X_CLUSTER_CLIENT_IP address for the allowed IP addresses.
Please login to continue.