CI_Input::ip_address()

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.

doc_CodeIgniter
2016-10-15 16:31:39
Comments
Leave a Comment

Please login to continue.