AoNo Posted January 16, 2012 Share Posted January 16, 2012 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.. Quote Link to comment https://forums.phpfreaks.com/topic/255099-web_root-need-help/ Share on other sites More sharing options...
xProteuSx Posted January 16, 2012 Share Posted January 16, 2012 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 ... Quote Link to comment https://forums.phpfreaks.com/topic/255099-web_root-need-help/#findComment-1308025 Share on other sites More sharing options...
AoNo Posted January 16, 2012 Author Share Posted January 16, 2012 it helps me a lot man....thank you so much for your help thank you thank you thank you Quote Link to comment https://forums.phpfreaks.com/topic/255099-web_root-need-help/#findComment-1308128 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.