Jump to content

web_root.. need help


AoNo

Recommended Posts

hi,

 

..when i login in into to the admin panel its works ok...when first time i select any link like category,product,order etc..it works for example i select category "http://localhost/plaincart/admin/category/" this link works ok but after that on second time when i try to switch into another link which is product or order so it make a link like that "http://localhost/plaincart/admin/category/product/" but it suppose to be like "http://localhost/plaincart/admin/product/"..

can anyone help me?

 

i think the problem is in here..

im not sure though..

 

this is in my config.php file..

 

$thisFile = str_replace('\\', '/', __FILE__);

$docRoot = $_SERVER['DOCUMENT_ROOT'];

 

$webRoot  = str_replace(array($docRoot, 'library/config.php'), '', $thisFile);

$srvRoot  = str_replace('library/config.php', '', $thisFile);

 

can anyone tell me what to do? thanks..

 

 

Link to comment
https://forums.phpfreaks.com/topic/255099-web_root-need-help/
Share on other sites

It is hard to say what is going on without seeing more code.

 

It looks like you are appending a directory to the current one.  For example, you might be doing this:

 

$dir = 'http://localhost/plaincart/admin/category/';

$dir .= 'product/';

 

That would generate http://localhost/plaincart/admin/category/product/;

 

I don't really know anything about $_SERVER, to be fair.

 

Maybe you should start like this:

 

$root_dir = 'http://localhost/plaincart/admin/';

$category_dir = $root_dir . 'category/';

$product_dir = $root_dir . 'product/';

 

That way you would always be starting from one directory.  Hope this helps ...

Link to comment
https://forums.phpfreaks.com/topic/255099-web_root-need-help/#findComment-1308025
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.