This is an archived forum post. The information may be outdated. Contact us if you have any questions.

Bypass login

sbyschool wrote on 2012-12-08:
The pages I want to output are login protected. Now the requests come from your remote server. Which host name would I have to tell my php to ignore logins for in order for the script to properly work?

This is what I am currently doing

if ( $_SERVER["REMOTE_ADDR"] == "")
//code to ignore login

This code works however i wonder if it not future proof...what if you change hosts or ips in the future. I cannot seem to get it working by hostname, I am trying the following:

if ( $_SERVER["REMOTE_HOST"] == "")
//code to ignore login

Unforunately it doesn't bypass the login. I got the value because it is what pdfcrowd.php uses but no luck with getting it to work here. Any ideas?
support wrote on 2012-12-08:
$_SERVER["REMOTE_HOST"] expands to the reverse dns hostname. For it is "". Note that your web server must be configured to create this variable.

If you are on Linux you can use the host utility to find out the hostname:
$ host domain name pointer