Abraham Garcia in PHP Scripts   Wednesday, August 2 2017

PHP Function to Get Client IP Address

A small function to retrieve the ip address of the user. This uses the PHP Server Method.

This is a function on how to retrieve users ip address. Use this for you projects. function get_client_ip() { $ipaddress = ''; if (isset($_SERVER['HTTP_CLIENT_IP'])) $ipaddress = $_SERVER['HTTP_CLIENT_IP']; else if(isset($_SERVER['HTTP_X_FORWARDED_FOR'])) $ipaddress

Continue reading