csjumper Posted August 26, 2010 Share Posted August 26, 2010 Hello am new to php and am working with a config file. But it always give me a wrong path to file /homedomains/xxxxx/public_html/ no / between home an domains.. am frustrated on how to solve this... plz help me in this an attaching the script file.. config file too [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
csjumper Posted August 26, 2010 Author Share Posted August 26, 2010 the original path it should get is /home/admin/domains/xxxxx/public_html/ but its getting /homedomains/xxxxx/public_html/ so its missing a whole /admin/ from path....... Quote Link to comment Share on other sites More sharing options...
tcsoftware Posted August 26, 2010 Share Posted August 26, 2010 You can use $_SERVER['DOCUMENT_ROOT'] to get the path to the root of your website Quote Link to comment Share on other sites More sharing options...
csjumper Posted August 26, 2010 Author Share Posted August 26, 2010 originally the one used is $_SERVER["SCRIPT_NAME"] bcz its a part of a big script so changing this function might cause some problems.. can u plz look at the file attached bcz i was thinking that some thing might be wrong with it...which is causing such a problem... i can,t figure out why /admin/ is missing from the path... /home/admin/domains/xxxxx/public_html/ but its getting /homedomains/xxxxx/public_html/ it getting the path but its wrong :|.. Quote Link to comment Share on other sites More sharing options...
tcsoftware Posted August 27, 2010 Share Posted August 27, 2010 I can't give you line numbers as the copy of the file I downloaded was wrapped at 80 characters and a little difficult to read However str_replace is used at least 3 times in there to remove /admin/, /members/, /cron/, etc... from URL's that it appears to be building. Quote Link to comment 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.