Click here to Skip to main content
15,890,882 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
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.
Posted
Comments
Sergey Alexandrovich Kryukov 10-Aug-13 23:57pm    
Why? This can be only your local PC's IPs, and you already know those.
—SA

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
 
Share this answer
 
v2
Comments
Anoop Kr Sharma 11-Aug-13 0:35am    
Totally agree with your solution.+5
Sergey Alexandrovich Kryukov 11-Aug-13 0:48am    
Thank you, Anoop.
—SA
[no name] 11-Aug-13 2:15am    
Again a GOOD answer...
Sergey Alexandrovich Kryukov 11-Aug-13 11:53am    
Thank you very much.
—SA
Manas Bhardwaj 11-Aug-13 4:34am    
Sure +5!
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[^]
 
Share this answer
 
v3
Comments
ridoy 11-Aug-13 4:08am    
how funny! downvoted after accepting as an answer and upvoted OP's comment which was given as a solution! How weird! :) :)
Manas Bhardwaj 11-Aug-13 4:34am    
Counter voted +5 :)
ridoy 11-Aug-13 4:42am    
:) :), thanks Manas.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900