Before you say it's a duplicate, I hereby state that i've tried everything on this site and it hasn't worked.
My problem is, i'm trying to get my site's visitor's IP adress to keep a log of who's accessing it, however, when I tested it with two different devices using the same internet connection, the IP is returning the same for the two.
When I tried with a device using 4G connection, it did show'd me a different IP. These IP's are varying from 9 to 12 charachters in length.
My question is: Are these the "connection's IP"? How do I get the specific device IP?
Current code used to get the IP:
$ip = getenv('HTTP_CLIENT_IP')?:
getenv('HTTP_X_FORWARDED_FOR')?:
getenv('HTTP_X_FORWARDED')?:
getenv('HTTP_FORWARDED_FOR')?:
getenv('HTTP_FORWARDED')?:
getenv('REMOTE_ADDR');
EDIT: This code is being run in the header.php file, wich is file being included from the index.php (main file).