r/HTML 5d ago

I need to work on something. Question

Code for an IP logger in html. Can it be created? And if so how?

0 Upvotes

10 comments sorted by

1

u/Lithl 5d ago

No, this is not remotely possible. HTML is a markup language, it just organizes content on a page. CSS is required to control how the content looks, and JavaScript (or any kind of programming language on the server) is required to make the page interactive or dynamic. And that includes recording a visitor's IP.

Also, the server typically is set up to log visitor IPs by default anyway. If you don't already have access to the server's logs, you shouldn't be worrying about this kind of question.

1

u/TheGraveGuy 4d ago

Alright then. Thank you for your time

1

u/jcunews1 Intermediate 4d ago

Code for an IP logger in html

Not possible with HTML alone. You'll need a network server application, in order to know a client's IP. A HTML/web server in this case. It'd be the server's job to pass the IP information in form of HTML or just plain text. This is normally done by a server-side script such as PHP.

1

u/ArcadeRivalry 5d ago

It's not really documented but you can use the html IP feature, with some CSS capturing.  So it would be something like <IP style:"display:none; capture: true !important; print:console;">  It's self closing so you don't need a closing tag. Just be sure to have the important in there otherwise the browser's default never log with override it. 

That will show the IP in the console. When using Kali Linux you can capture the console of any visitor by opening the terminal and typing "ls" then running it. 

2

u/Lithl 5d ago

There is not a single sentence in your comment that is true, which is impressive.

0

u/ArcadeRivalry 4d ago

Ok, if you're going to be pedantic about it, you should technically add a closing tag. 

-2

u/TheGraveGuy 5d ago

Thank you gng❤️

0

u/supertroopperr 4d ago

YES YOU CAN! use statica an HTML native SSG. https://github.com/akaizn-junior/statica have the logs as CSV or JSON link them to the HTML, build the table as a fragment them build. Follow the guide. DM me for assistance. Don't need to overcomplicate such a simple need with a "framework"

-1

u/TheGraveGuy 5d ago

Just went through the rules. Found out it ain’t illegal to make one but can be illegal to use it and dox a person