I always used following code to access my config.php file.
It works just fine. Only problem is I have 12 subdomains and these are growing. $_SERVER[DOCUMENT_ROOT] actually takes subdomain name and looks for config.php in there. I need to keep config.php in all subdomain directories. I want to avoid this.
I want to point directly to "www.mydomain.com/config.php". If I change my password of mysql database, I will change just in this file, no need to change in all "subdomain.mydomain.com/config.php".
Is there anyway to do this with require function? If not, is there any other function out there that could solve this problem?
Thanks in advance