0

I can find a lot of information how to get public Ip but not the ethernet one. I am not sure if the you should get the ethernet one as easy as the public one in php.

Rafal
  • 3
  • 3
  • By `ethernet one` do you mean LAN address? – user3783243 Mar 08 '22 at 16:40
  • 3
    I'm assuming you mean the clients internal IP? You can't. That information isn't available for external servers (nor should it be). – M. Eriksson Mar 08 '22 at 16:48
  • I ment the user device id. – Rafal Mar 08 '22 at 17:50
  • 1
    A server only knows the IP address of the machine that's connecting to it, which is typically a router and sometimes a proxy. Some proxies add a `x-forwarded-for` HTTP header as a commodity (not really something to be trusted), but I suspect routers don't (a LAN address is private to that LAN). – Álvaro González Mar 08 '22 at 18:07
  • Alright, so there is no way to get the device Ip, I mean for ex. a user logs from a PC. to a website and I need to know the user device IP. So if someone would try to log from a diffrent IP it would send an email to the user with the information "If that is you". – Rafal Mar 08 '22 at 18:27
  • 1
    That's what public IP and maybe `x-forwarded-for` are used for. Private addresses aren't unique. – Álvaro González Mar 08 '22 at 18:31

0 Answers0