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. Link to comment https://forums.phpfreaks.com/topic/92757-getting-the-ip/ 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. Link to comment https://forums.phpfreaks.com/topic/92757-getting-the-ip/#findComment-475229 Share on other sites More sharing options...
verdrm Posted February 24, 2008 Author Share Posted February 24, 2008 Is there another solution then? Link to comment https://forums.phpfreaks.com/topic/92757-getting-the-ip/#findComment-475232 Share on other sites More sharing options...
AndyB Posted February 24, 2008 Share Posted February 24, 2008 Is there another solution then? To what? Link to comment https://forums.phpfreaks.com/topic/92757-getting-the-ip/#findComment-475235 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']; Link to comment https://forums.phpfreaks.com/topic/92757-getting-the-ip/#findComment-475236 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. Link to comment https://forums.phpfreaks.com/topic/92757-getting-the-ip/#findComment-475237 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.