I want to assign client IP which i got from my ISP to my localhost and not default IP: 127.0.0.1. I have apache server installed in my personal computer and want these settings locally.
I just want to run a test program from my localhost. I always get 127.0.0.1 when i try by $_SERVER['HTTP_CLIENT_IP'] or $_SERVER['REMOTE_ADDR'] or $_SERVER['HTTP_X_FORWARDED_FOR'] locally.
You have to travel from the outside in. Or just use your Private IP (normally 192.168.1.xxx) from your your own network. But the end result will still be the same. REMOTE_ADDR contains the IP of the connecting client. But HTTP_CLIENT_IP and HTTP_X_FORWARDED_FOR DO NOT, they can contain bad things.
Logic without the fatal effects.
All code snippets are licensed under WTFPL.
Bookmarks