When I look up my ip address on a website, it offers both my IPv6 and IPv4 address. When I use a PHP-script it only return the IPv6 address (both $_SERVER['REMOTE_ADDR'] and getenv('REMOTE_ADDR')).
How do these websites get my IPv4 address?
I have looked into all the $_SERVER variables but cannot find it.
You’ll need to run the website on three different host names:
On the last two, put a script that returns or stores the client’s IP address. Make the client visiting the website on the normal host name connect to the other two and include an identifier so the requests can be linked together in some way, and collect the resulting data.