Dysan Posted May 22, 2008 Share Posted May 22, 2008 Hello! Using PHP, how do I retrieve a users IP Address? Link to comment https://forums.phpfreaks.com/topic/106802-retrieve-users-ip-address/ Share on other sites More sharing options...
rhodesa Posted May 22, 2008 Share Posted May 22, 2008 $_SERVER['REMOTE_ADDR'] More on this variable: http://us.php.net/manual/en/reserved.variables.server.php Link to comment https://forums.phpfreaks.com/topic/106802-retrieve-users-ip-address/#findComment-547488 Share on other sites More sharing options...
Dysan Posted May 22, 2008 Author Share Posted May 22, 2008 That just displays the ip of my server "Localhost" (127.0.0.1) How do I display the users internet address (Clients IP Address) e.g. xx.xxx.xxx.xxx? Link to comment https://forums.phpfreaks.com/topic/106802-retrieve-users-ip-address/#findComment-547573 Share on other sites More sharing options...
jonsjava Posted May 22, 2008 Share Posted May 22, 2008 test it from outside your testing box. you're seeing 127.0.0.1 because you're looking at localhost. if someone else was to go there, they would see their IP address. Link to comment https://forums.phpfreaks.com/topic/106802-retrieve-users-ip-address/#findComment-547577 Share on other sites More sharing options...
rhodesa Posted May 22, 2008 Share Posted May 22, 2008 test it from outside your testing box. you're seeing 127.0.0.1 because you're looking at localhost. if someone else was to go there, they would see their IP address. what he said Link to comment https://forums.phpfreaks.com/topic/106802-retrieve-users-ip-address/#findComment-547599 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.