Vigilant Psyche Posted May 18, 2008 Share Posted May 18, 2008 Is there a way to get any users IP address? I tried $_SERVER['REMOTE_ADDR'] but that doesn't seem to give the proper ip address... Link to comment https://forums.phpfreaks.com/topic/106162-get-a-users-ip-address-for-banning/ Share on other sites More sharing options...
runnerjp Posted May 18, 2008 Share Posted May 18, 2008 $ipaddress = ss($_SERVER['REMOTE_ADDR']); Link to comment https://forums.phpfreaks.com/topic/106162-get-a-users-ip-address-for-banning/#findComment-544165 Share on other sites More sharing options...
Cory94bailly Posted May 18, 2008 Share Posted May 18, 2008 $ipaddress = ss($_SERVER['REMOTE_ADDR']); What's "SS" for? The correct one is: $ipaddress = ($_SERVER['REMOTE_ADDR']); And I did this to see my own ip and checked it with ipchicken, worked great: <? $ipaddress = ($_SERVER['REMOTE_ADDR']); echo "$ipaddress"; ?> Link to comment https://forums.phpfreaks.com/topic/106162-get-a-users-ip-address-for-banning/#findComment-544211 Share on other sites More sharing options...
phpSensei Posted May 18, 2008 Share Posted May 18, 2008 It doesn't matter if its not the correct one, whatever IP they are using will be the same when they use your site. The ip ban will still work, unless they use a proxy. Thats when you use Geolocation http://www.maxmind.com/app/php Link to comment https://forums.phpfreaks.com/topic/106162-get-a-users-ip-address-for-banning/#findComment-544216 Share on other sites More sharing options...
Cory94bailly Posted May 18, 2008 Share Posted May 18, 2008 It doesn't matter if its not the correct one, whatever IP they are using will be the same when they use your site. The ip ban will still work, unless they use a proxy. Thats when you use Geolocation http://www.maxmind.com/app/php No, he posted the code wrong.. He put in a the letters "SS" Link to comment https://forums.phpfreaks.com/topic/106162-get-a-users-ip-address-for-banning/#findComment-544219 Share on other sites More sharing options...
runnerjp Posted May 18, 2008 Share Posted May 18, 2008 woops where did my ss come from... sorry lol Link to comment https://forums.phpfreaks.com/topic/106162-get-a-users-ip-address-for-banning/#findComment-544223 Share on other sites More sharing options...
Vigilant Psyche Posted May 18, 2008 Author Share Posted May 18, 2008 OK thanks it works! Link to comment https://forums.phpfreaks.com/topic/106162-get-a-users-ip-address-for-banning/#findComment-544257 Share on other sites More sharing options...
GingerRobot Posted May 18, 2008 Share Posted May 18, 2008 I would suggest a certain amount of caution with this approach. See this thread for a bit of a discussion on the problems of retrieving a true IP. Link to comment https://forums.phpfreaks.com/topic/106162-get-a-users-ip-address-for-banning/#findComment-544268 Share on other sites More sharing options...
runnerjp Posted May 18, 2008 Share Posted May 18, 2008 this is why i never bother blocking ips... i can trace them for posts ect to see if user posted a post but i just block users account... ok the may sign up again but ill just keep blockin it knowing 1day they will get bored lol Link to comment https://forums.phpfreaks.com/topic/106162-get-a-users-ip-address-for-banning/#findComment-544272 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.