Defeat Posted November 27, 2011 Share Posted November 27, 2011 How do I need to do that, I've tried some before, but for some reason it didn't work. I've lost my code-.- so I can't show it... It was something with: $_SERVER['REMOTE_ADDR'] but when I echo'd it, it would only show::1 which is probably from 127.0.0.1, I guess? Would this still work if I stored this in a table when someone else is visithing the site. Thank you:) Link to comment https://forums.phpfreaks.com/topic/251882-get-visitors-ip-store-it/ Share on other sites More sharing options...
QuickOldCar Posted November 27, 2011 Share Posted November 27, 2011 $_SERVER['REMOTE_ADDR'] should get the visiting ip address Link to comment https://forums.phpfreaks.com/topic/251882-get-visitors-ip-store-it/#findComment-1291551 Share on other sites More sharing options...
floridaflatlander Posted November 27, 2011 Share Posted November 27, 2011 that'a what i use ad on my localhost i get 127.0.0.1 Link to comment https://forums.phpfreaks.com/topic/251882-get-visitors-ip-store-it/#findComment-1291553 Share on other sites More sharing options...
fenway Posted November 27, 2011 Share Posted November 27, 2011 that'a what i use ad on my localhost i get 127.0.0.1 So why not test it on a live site? Link to comment https://forums.phpfreaks.com/topic/251882-get-visitors-ip-store-it/#findComment-1291567 Share on other sites More sharing options...
The Little Guy Posted November 29, 2011 Share Posted November 29, 2011 ::1 is the IPv6 equivalent of IPv4 127.0.0.1 address. You can convert IPv6 address to IPv4 address using function inet_ntop() http://php.net/manual/en/function.inet-ntop.php Link to comment https://forums.phpfreaks.com/topic/251882-get-visitors-ip-store-it/#findComment-1292387 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.