How do i access the user's ip address?

php

#1

whenever i type echo $_SERVER[‘REMOTEADDR’] i get a private ip address and not the actual user ip


#2

http://stackoverflow.com/questions/25237142/how-to-get-real-ip-of-user-using-php is an excellent summary of how to get a user IP, and why you should only use an IP address if it is not critical (for instance, do not use IP addresses to authenticate users, as that address can easily be forged)