I require a config.php file at the top of every page on my site.
I am using this method:
<?php require $_SERVER['DOCUMENT_ROOT'].
Though, sometimes there is a subdomain (which the document root would be different), and instead of hard coding a path in, I would rather use one of the server variables that is good site wide.
Do you have a different suggestion for one that I can use? I looked into PHPRC, but to me that seems where the php.ini file location is, right?
What do you recommend?
I also want to do this so I can have the same code on every page whether I'm live or local, is that doable or do you have a different suffestion?
if $_SERVER['SERVER_ADDR'] = "188.8.131.52"
else if $_SERVER['SERVER_ADDR'] = "10.20.30.40"
else echo "You have problems!"