Skip to main content
spelling in title
Source Link
Cœur
  • 39k
  • 25
  • 207
  • 282

php: getinggetting ip addresaddress

iI want to get an ip addresaddress of visitors. could you tell me what element of $_SERVER[] i should use?

$_SERVER['HTTP_CLIENT_IP']; $_SERVER['HTTP_X_FORWARDED_FOR']; or $_SERVER['REMOTE_ADDR']; 

thanks

UPDATE:

If your client is connected to the Internet through Proxy Server then $_SERVER['REMOTE_ADDR'] in PHP just returns the the IP address of the proxy server not of the client’s machine.There are extra Server variable which might be available to determine the exact IP address of the client’s machine in PHP, they are HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR.

php: geting ip addres

i want to get an ip addres of visitors. could you tell me what element of $_SERVER[] i should use?

$_SERVER['HTTP_CLIENT_IP']; $_SERVER['HTTP_X_FORWARDED_FOR']; or $_SERVER['REMOTE_ADDR']; 

thanks

UPDATE:

If your client is connected to the Internet through Proxy Server then $_SERVER['REMOTE_ADDR'] in PHP just returns the the IP address of the proxy server not of the client’s machine.There are extra Server variable which might be available to determine the exact IP address of the client’s machine in PHP, they are HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR.

php: getting ip address

I want to get an ip address of visitors. could you tell me what element of $_SERVER[] i should use?

$_SERVER['HTTP_CLIENT_IP']; $_SERVER['HTTP_X_FORWARDED_FOR']; or $_SERVER['REMOTE_ADDR']; 

UPDATE:

If your client is connected to the Internet through Proxy Server then $_SERVER['REMOTE_ADDR'] in PHP just returns the the IP address of the proxy server not of the client’s machine.There are extra Server variable which might be available to determine the exact IP address of the client’s machine in PHP, they are HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR.

edited tags
Link
Jacco
  • 23.9k
  • 18
  • 92
  • 106
added 1 characters in body; added 372 characters in body
Source Link
Simon
  • 23.2k
  • 36
  • 95
  • 123

i want to get an ip addres of visitors. could you tell me what element of $_SERVER[] i sholdshould use?

$_SERVER['HTTP_CLIENT_IP']; $_SERVER['HTTP_X_FORWARDED_FOR']; or $_SERVER['REMOTE_ADDR']; 

thanks

UPDATE:

If your client is connected to the Internet through Proxy Server then $_SERVER['REMOTE_ADDR'] in PHP just returns the the IP address of the proxy server not of the client’s machine.There are extra Server variable which might be available to determine the exact IP address of the client’s machine in PHP, they are HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR.

i want to get an ip addres of visitors. could you tell me what element of $_SERVER[] i shold use?

$_SERVER['HTTP_CLIENT_IP']; $_SERVER['HTTP_X_FORWARDED_FOR']; or $_SERVER['REMOTE_ADDR']; 

thanks

i want to get an ip addres of visitors. could you tell me what element of $_SERVER[] i should use?

$_SERVER['HTTP_CLIENT_IP']; $_SERVER['HTTP_X_FORWARDED_FOR']; or $_SERVER['REMOTE_ADDR']; 

thanks

UPDATE:

If your client is connected to the Internet through Proxy Server then $_SERVER['REMOTE_ADDR'] in PHP just returns the the IP address of the proxy server not of the client’s machine.There are extra Server variable which might be available to determine the exact IP address of the client’s machine in PHP, they are HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR.

Source Link
Simon
  • 23.2k
  • 36
  • 95
  • 123
Loading