Recently I needed to tell if the client, who was requesting a page, was on the same machine as the server itself.
I was constructing a link such as "a href="/usr/bin"
And I wanted the link to work, but only if the client and server were on the same machine. So I thought one way of checking would be to compare the remote and server addresses in the environment variables. If they matched, then I could generate the link in my CGI script to display on an HTML page. Otherwise, I would leave out the link.
Are there better ways of doing this?