如何使用HTML检测访问者的IP地址? [英] How to detect the visitor's IP address using HTML?
本文介绍了如何使用HTML检测访问者的IP地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何使用HTML为我的网站检测访客IP地址?
我有一个contactform.html和一个formsent.html。
当formsent.html发送联系信息到我的电子邮件时,我也想看到他们的IP地址!
$ ip = $ _ SERVER ['REMOTE_ADDR'];
How can i detect the visitors IP Address using HTML for my website? I have a contactform.html and a formsent.html. And when formsent.html sends the contact info to my email i also want to see their IP Address!
解决方案
You can't do it through HTML. However, you can find the IP address of a visitor through PHP.
$ip=$_SERVER['REMOTE_ADDR'];
这篇关于如何使用HTML检测访问者的IP地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文