I have self written CMS which does not return correct user's IP address with the following:
define("USER_IP", $_SERVER['HTTP_X_FORWARDED_FOR']);
It gives me the following notice:
Notice: Undefined index: HTTP_X_FORWARDED_FOR in /var/www/p00000/data/www/domain.ru/core/maincore.php on line 30
and line 20 = to the line define("USER_IP"...
A few question:
- What should I do to get rid of this notice message?
- How can I properly get user's IP address?
Thank you for your help!