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... Quote Link to comment Share on other sites More sharing options...
runnerjp Posted May 18, 2008 Share Posted May 18, 2008 $ipaddress = ss($_SERVER['REMOTE_ADDR']); Quote Link to comment 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"; ?> Quote Link to comment 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 Quote Link to comment 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" Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Vigilant Psyche Posted May 18, 2008 Author Share Posted May 18, 2008 OK thanks it works! Quote Link to comment 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. Quote Link to comment 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.