For a while now I used something like the following to get a good include()
path for my PHP code.
if (!defined("BASE_PATH")) define('BASE_PATH', $_SERVER['DOCUMENT_ROOT'].'/mrp'));
require_once(BASE_PATH."/config/cn.php");
However, I was hit with the realization that it won't work with my new Apache setup, which goes something like the following:
ServerRoot "X:/home/abdallah/xampplite/apache"
DocumentRoot "X:/home/abdallah/xampplite/htdocs"
<ifmodule>
Alias /mrp "X:varwwwmanufac"
</ifmodule>
<directory>
AllowOverride None
Options all
Order allow,deny
Allow from all
</directory>
So, $_SERVER['DOCUMENT_ROOT']
no longer works!
Instead I've reverted to something like the following:
if (!defined("BASE_PATH")) define('BASE_PATH', substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), 'mrp')+3));
Similar Posts:
- None Found
No Comments
You can leave the first : )