Conditional Hyperlinks
The premise here is to have external links that are only available to me and are hidden for everyone else.
The design theory is that a check of the IP address that I am currently assigned is the same as one that I have previously stored, then the links will be hidden.
As I develop my pages off-line mearly checking to see if I am online is not sufficient even though I am accessing the HTML from a local source and not the webserver. I am okay to have the hyperlinks hidden if the page is accessed from the server even if it is me although if I can get this to work then the same logic would apply.
Using AI I have found a way to return my current IP address to the webpage that is being viewed. At the time of writing this the IP address is echoed to the console. I also admit that I don't currently understand how this works.
My IP address at the time of starting this page is 168.86.204.58. I need to develop a function to write this IP address to a file on the server.
The conditional link will only display if the IP address is the same as that retrieved from the file.
The two buttons below just change the text of the link. I need to add a w3-hide to the link(s)
Using ipify to get my current IP address
This is uncannily easy.