如何使用 HTML 检测访问者的 IP 地址? [英] How to detect the visitor's IP address using HTML?

查看:40
本文介绍了如何使用 HTML 检测访问者的 IP 地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何使用 HTML 为我的网站检测访问者的 IP 地址?我有一个contactform.html 和一个formsent.html.当 formsent.html 将联系信息发送到我的电子邮件时,我也想查看他们的 IP 地址!

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!

推荐答案

你不能通过 HTML 来完成.但是,您可以通过 PHP 找到访问者的 IP 地址.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆