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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.