External IP address
Technology may have changed in the meantime.
I’ve been a freelance web developer for almost 15 years.
One of the most brilliant web pages I ever made, was this one:
<?php header('Content-Type: text/plain'); echo $_SERVER['REMOTE_ADDR']; ?>
And if you think I’m joking, allow me to give you some background…
The above code returns a page with no other content than the visitor’s IP address. This may seem trivial and rather useless, but consider the following:
You’re developing a website. It’s a website for, obviously, someone who is not a web developer, which means, especially for people of my generation and older, that they know close to nothing about this internet-thing.
At a certain moment, you want to show them what you’ve done so far, but you do not want the rest of the internet to find the website already. But you also know that this person, having other hobbies than learning all the ins and outs of this new technology, will type the URL you send them into the Google search field, thinking that that is the location bar you were talking about. And once Google gets hold of something, you can be sure it will be out there for everybody to find.
So, you need to make sure only your customer can access this new website; this way, you can be sure that even if Google has the address, it won’t be able to index the site. And the most practical way to make sure only the client can access the site, is to limit access to the client’s IP address. But how does one explain to this lay person where to find their external IP address?
And that’s why I came up with the code above. With that in place, I could just ask my client to go to https://www.example.com/ip.php, copy all the text they find there, and mail it to me. Their reply would always be something like “It only says 203.0.113.45. Are you sure?“, to which I always replied “That’s all I need. Thank you!“.
The lesson here: When working with lay people, make sure that there is nothing that they may want to interpret or filter.
And even though I no longer develop websites for clients, I still have a use for this page that was invented about 15 years ago: to find my own IP address (I travel a lot) and, with the small enhancement I made, also to verify my TOR connection.
So, I thought I’d share.