Jump to content

Getting the IP


verdrm

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.