获取客户端HTML的IP

编程入门 行业动态 更新时间:2024-10-16 02:27:37
本文介绍了获取客户端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 .. forums.asp/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.. forums.asp/t/1801725.aspx/1[^]

更多推荐

获取客户端HTML的IP

本文发布于:2023-11-25 23:44:37,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1631819.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:客户端   HTML   IP

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!