Hey all - this probably won't be a difficult problem for you guys to solve, but I'm not that great with UNIX so I'm lost.
I want to include() a script that contains my database connection information in the header file that goes on every page of my site. So, something like this:
include("dbcnx.php");
Now, that file, dbcnx.php, happens to reside in a folder that's not in the public_html directory of my site (for security reasons). So, if the header file is immediately inside the public_html folder, I'd have to write something like this:
include("../includes/dbcnx.php");
The problem is that the site's directory structure is more complicated than that, and often the include() statement will appear somewhere like public_html/docs/forms/members.php
In that case, something like include("../includes/dbcnx.php"); wouldn't work. I guess I need something that has an absolute path reference. But using /../includes/dbcnx.php doesn't seem to work, and possibly it shouldn't.
Does that path even make sense? If not, how should I write the path so that I can access the includes folder from any page of the site?
Thanks! Hope this wasn't too confusing...
-Aaron