How To Get Users IP Address in PHP
There are many tutorial to get users IP address, for instance like this or this. The problem is that HTTP_XXX $_SERVER variables is easily spoofed. It's not reliable because the user can fake it with a simple header addition.
The only real solution to retrieve the client IP address is using $_SERVER['REMOTE_ADDR'], unless your website is serving behind reverse proxy such as NGINX or TrafficServer, than you can safely use $_SERVER['HTTP_X_FORWARDED_FOR']
Btw, note that X-Forwarded-For can contain several IP addresses instead of just one. There's also Via header (much like Received in email headers) which you can use for more information. And we're back with the problem that these headers can be manipulated by the client :-)
Kalo public IP agaknya masih bisa di akalin ya salah satu contoh seperti yang mas steven diatas c",) kalo local/VPN saya lebih cendrung pake MAC Address. Kalau punya akses ke router mungkin bisa kombinasikan dengan ARP / IP Route / IP Tables/Chain memang "agak sangat" repot
sfsfsfsf