verdrm Posted February 24, 2008 Share Posted February 24, 2008 I would like to get the IP of the client machine. Here is my code: $client = array("202.212.210.168","78.123.101.1"); $ip = $_SERVER['REMOTE_ADDR']; if(in_array($ip,$client)){ The problem is that $_SERVER['REMOTE_ADDR']; gives me the address internally of the server and not of the client when I echo $ip. Quote Link to comment Share on other sites More sharing options...
Bauer418 Posted February 24, 2008 Share Posted February 24, 2008 $_SERVER['REMOTE_ADDR'] is the IP address of the user connecting to your website. Sometimes it can return the wrong value if the client is connecting behind a certain firewall or proxy. Quote Link to comment Share on other sites More sharing options...
verdrm Posted February 24, 2008 Author Share Posted February 24, 2008 Is there another solution then? Quote Link to comment Share on other sites More sharing options...
AndyB Posted February 24, 2008 Share Posted February 24, 2008 Is there another solution then? To what? Quote Link to comment Share on other sites More sharing options...
verdrm Posted February 24, 2008 Author Share Posted February 24, 2008 To getting the IP without using $_SERVER['REMOTE_ADDR']; Quote Link to comment Share on other sites More sharing options...
Orio Posted February 24, 2008 Share Posted February 24, 2008 Not really. Check the users notes here. Orio. 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.