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"] == "69.164.218.62")
//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"] == "pdfcrowd.com")
//code to ignore login


Unforunately it doesn't bypass the login. I got the value pdfcrowd.com 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 69.164.218.62 it is "crowd.pdfcrowd.com". 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 69.164.218.62
62.218.164.69.in-addr.arpa domain name pointer crowd.pdfcrowd.com.