DarkHavn Posted November 1, 2006 Share Posted November 1, 2006 Hey there, i've currently uploaded my site to a hosting server and trying to get everything working properly.In saying that, this web hosting company doesn't support '../' to go to a parent directory due to some 'security reasons'I have been trying absolute paths but that doesn't seem to work either.But ill give you a fair idea of the path/home/localfind (This is the main folder that is set up for me)now i have /home/localfind/site (is the current directory that i am in, and in saying that, i want to get to/home/localfind/Clients (but apparently this wont work?)here is the img i am trying to display[code]echo $_SERVER['DOCUMENT_ROOT']; //Displays /home/localfind/siteecho '<td><a href="info.php?identifier=' . $ident[$x] . '" >' . $title[$x] . "<br/><img src="/home/localfind/Clients/" . $buisness[$x] . "/images/" . $thumb[$x] . "' title=" . $info[$x] . "></a></td>";echo "</tr>";[/code]Can't see where i am going wrong?Please help. ive been awake for 36 hours trying to figure this out, its racking my brain and i can't sleep due to this :( grr Quote Link to comment https://forums.phpfreaks.com/topic/25778-path-help/ Share on other sites More sharing options...
btherl Posted November 1, 2006 Share Posted November 1, 2006 The short answer is.. your web host has configured the website so that what you are trying to do is impossible.You can either ask them to change the configuration (not likely), or you can move those images you want to display under the document root. For example, put them in /home/localfind/site/Clients , instead of /home/localfind/ClientsYou will need to be sure that sensitive files aren't under the Clients directory as well.. you may need to store some files in seperate locations, or add access controls to particular paths.Then your html will be[code]"<img src='/Clients/{$business[$x]}/images/{$thumb[$x]}'>"[/code]The {} syntax allows you to put variables inline into a string, even if they are things like array elements. Quote Link to comment https://forums.phpfreaks.com/topic/25778-path-help/#findComment-117716 Share on other sites More sharing options...
DarkHavn Posted November 1, 2006 Author Share Posted November 1, 2006 Hey cool man, thanks for that you were a real help.Just a quick question, in saying that, placing the clients folder into the site root folder i can easily access the images there, but then i have an admin section that takes those images and places them into the clients folder, the code makes a dir for the client etc.since i can't seem to backtrack to the preceeding root folder, is there a method or a way that i could go about doing that?, because if i place that catalogue folder inside the site folder as well, then i have other folders that access that catalogue folder and i can't back track so i create the same dilema over and over again.should i place all of the admin elements inside the site folder it's self?, but i also need to be aware of security and sensitive data such as my code.Hrrm another conundrum? Quote Link to comment https://forums.phpfreaks.com/topic/25778-path-help/#findComment-117727 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.