问题
I am trying to find the IP address using HTML coding but I cannot. Is it possible to find the IP address in HTML without using JavaScript or PHP?
ping -a ip-adress
It displays ping only
回答1:
PHP is required - with HTML only its not possible.
回答2:
If Apache is set to resolve IP addresses, then you can use <!--#echo var="REMOTE_HOST" -->
. However, it is unlikely that your host has that option enabled, because it makes requests take longer.
回答3:
You're right, it is not possible in pure HTML/Javascript.Did you need local IP of PC where browser is running on or remote PC of user which is connected to web server?
回答4:
If you insist, you can create an iframe to load the IP and the iframe page will use JavaScript or php etc.. to make the result.
来源:https://stackoverflow.com/questions/8700730/how-to-find-ip-address-using-html