PHP Help Web_Root
Posted: Fri Jan 30, 2009 7:20 am
Hi,
I am a novice when it come sto PHP so please bare with me.
I am trying to create a admin section to my website so that i may manage products and categories so i used something called plaincart, however when i log into the admin section i am confronted with a error that a file could not be located, i believe this is because of this piece of coding found in the config.php, could anyone make some sense out of this for me in a idiot proof way.
Thanks
$thisFile = str_replace('\\', '/', __FILE__);
$docRoot = $_SERVER['DOCUMENT_ROOT'];
$webRoot = str_replace(array($docRoot, 'library/config.php'), '', $thisFile);
$srvRoot = str_replace('library/config.php', '', $thisFile);
define('WEB_ROOT', $webRoot);
define('SRV_ROOT', $srvRoot);
I am a novice when it come sto PHP so please bare with me.
I am trying to create a admin section to my website so that i may manage products and categories so i used something called plaincart, however when i log into the admin section i am confronted with a error that a file could not be located, i believe this is because of this piece of coding found in the config.php, could anyone make some sense out of this for me in a idiot proof way.
Thanks
$thisFile = str_replace('\\', '/', __FILE__);
$docRoot = $_SERVER['DOCUMENT_ROOT'];
$webRoot = str_replace(array($docRoot, 'library/config.php'), '', $thisFile);
$srvRoot = str_replace('library/config.php', '', $thisFile);
define('WEB_ROOT', $webRoot);
define('SRV_ROOT', $srvRoot);