获取客户端HTML的IP [英] Get IP in HTML of client

查看:149
本文介绍了获取客户端HTML的IP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在创建自己的html文件,并且 NOT 将出现在任何类型的服务器或网站上,但它将作为HTML文件保留在我的计算机上。我需要我的html文件来显示客户端的IP。我不需要IP地址去任何地方,我只是希望我的HTML文件显示IP。请帮忙。我一直试图找到一些可以在3天内完成这项任务的代码。我刚刚开始使用HTML,所以如果你能把整个代码作为一个例子,请做。

解决方案

你看错了方向。



HTML本身没有这样的功能,但HTTP服务器和协议都有。如果您只是将HTML用作文件,无论您做什么,它都与HTTP无关,并且通常与网络无关。 HTML只不过是文档的标记语言。



另请参阅我对问题的评论。



-SA


您无法通过HTML执行此操作,因为SA声明HTML只是文档的标记语言。它没有做任何事情 - 只是构造内容。你可以用PHP做它...

如何检测访问者-ip-address-using-php [ ^ ]

或javascript ..

http://forums.asp.net/t/1801725.aspx/ 1 [ ^ ]

I'm creating my own html file, and it's NOT going to be on any server or website of any sort, but it's going to stay on my computer as an HTML file. I need my html file to show the IP of the client. I don't need the IP address to go anywhere, I just want my HTML file to display the IP. Please help. I've been trying to find some sort of code that can do this for 3 days now. I just started HTML, so if you could give the whole code as an example, please do.

解决方案

You are looking in wrong direction.

HTML itself has no such capabilities, but HTTP server and protocol do. If you just use HTML as a file, no matter what you do, it has nothing to do with HTTP in particular, and with networking in general. HTML is nothing but a markup language for documents.

See also my comment to the question.

—SA


You can't do it through HTML as SA stated HTML is only a markup language for documents. It doesn't do anything - just structures content.You can do it in PHP like..
How-to-detect-the-visitors-ip-address-using-php[^]
or in javascript..
http://forums.asp.net/t/1801725.aspx/1[^]


这篇关于获取客户端HTML的IP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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