Chrismichaelz wrote:So this is just used to get my document paths?
Well, almost, the post I submitted Today 11:05 AM was an effort to help you discover the absolute path (directory path on your server) to your updates.php script. Illzz last post was an attempt to make it more clear how to go about that.
Here is the issue...we still don't know if all your php scripts that include updates.php reside under your website that you posted or if they reside under various websites (all on that same server of course.)
Scenario 1: ALL IN SAME WEBSITE (same virtual root)
In this case, the path to all your files will start with the same directory path to your website folder. (it might be /home/chrismichaelz/html_pub/yoursite for example.) In this case, any PHP script that runs anywhere in your website can get the path to the virtual root (/home/chrismichaelz/html_pub/yoursite) just by returning
$_SERVER['DOCUMENT_ROOT']
. Thus to get the proper path to your updates file, you can simply write all your include statements as...
include($_SERVER['DOCUMENT_ROOT'] . "/updates.php");
Scenario 2: SOME (OR ALL) IN DIFFERENT WEBSITES
In this case when you return the value for...
$_SERVER['DOCUMENT_ROOT']
you will get the directory path to the virtual root for the website in which your CURRENT PHP scripts reside. Consequently...
include($_SERVER['DOCUMENT_ROOT'] . "/updates.php");
will not be the proper path to that one include file you want to maintain.
In this case just write in the path to your one updates.php file...
include("/home/chrismichaelz/html_pub/updates.php");
. Since we (illzz and I) don't know what...
echo $_SERVER['DOCUMENT_ROOT'];
returns, it's up to you to figure out the directory path to your one file.
There's a good chance that updates.php is world readable (readable by any user on the server) by default. But if you get permission errors on the include, you may need to make it world readable.
More on navigating paths in *nix operating systems.
Good luck!