chak Posted 12 hours ago Posted 12 hours ago To Whom It May Concern I am using VPS133 to study PHP programming. I have encountered an issue while developing a PHP application. When I try to retrieve a visitor's IP address, my code only returns the IPv6 address. However, I need to obtain both the IPv4 and IPv6 addresses (when available). Could you please advise whether this is related to the server or network configuration, and let me know if there is a way to retrieve both IPv4 and IPv6 addresses from visitors? Your assistance would be greatly appreciated. Thank you for your support. Kind regards Chakkrapong Quote
wolstech Posted 1 hour ago Posted 1 hour ago I assume you're using $_SERVER['REMOTE_ADDR'] to get this value...if both the server and the visiting device support IPv6, it's typically going to be preferred. PHP can only see the IP of the connection used to call the script, so if the connection came in on IPv6, you'll see an IPv6 address. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.