Dathremar Posted April 23, 2008 Share Posted April 23, 2008 Not sure if this is the right place to post this but here it goes... I have 1 domain to the web site and another domain thats 1 folder deeper in the directory tree. Example. domain1 pictures pages domain2 Now, when I log in on the domain2 (admin pages) and I have a page there for administrating pictures which are in the folder pictures. I get on the page only blank spaces where the pictures should be (usually a path problem). I recently transfered to linux server so maybe it is something related to this? I am using this path: ../../pictures/picture.name Already checked the uper/lower case of the names it is not that ... Thx for your time Quote Link to comment https://forums.phpfreaks.com/topic/102498-solved-path-problem/ Share on other sites More sharing options...
JSHINER Posted April 23, 2008 Share Posted April 23, 2008 To get to pictures from domain2 you should just do "../pictures/picture.name" Quote Link to comment https://forums.phpfreaks.com/topic/102498-solved-path-problem/#findComment-524821 Share on other sites More sharing options...
Dathremar Posted April 23, 2008 Author Share Posted April 23, 2008 But that doesn't work ??? tried that already and i tried adding a picture on the page which is within the domain2 and that worked with no prob... but when i try to add a picture which is located under the domain1 then i have problem ... Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/102498-solved-path-problem/#findComment-524832 Share on other sites More sharing options...
Dathremar Posted April 23, 2008 Author Share Posted April 23, 2008 Funny thing is that i use in the php code commands like: $logo_on_size = round((filesize($path.$db_3->row('logo_on')))/1024, 2); and $img = @imagecreatefromgif($path.$db_3->row('logo_on')); $path variable is the relative path to the pictures folder and i keep the name of the pic in the database. and that gives me correct values, but the picture doesnt show ... I am confused Quote Link to comment https://forums.phpfreaks.com/topic/102498-solved-path-problem/#findComment-524833 Share on other sites More sharing options...
PFMaBiSmAd Posted April 23, 2008 Share Posted April 23, 2008 Pictures (all media) is fetched by the browser. The URL that is formed by taking the current address of the page in the browser and appending the relative URL you are using in your HTML is what the browser will request. Don't confuse this will file system paths on the server. The code you posted using $path is accessing the file through the file system, not as a URL from the browser. Quote Link to comment https://forums.phpfreaks.com/topic/102498-solved-path-problem/#findComment-524869 Share on other sites More sharing options...
Dathremar Posted April 23, 2008 Author Share Posted April 23, 2008 Thx for the info .. didnt know that. This same thing worked on my local server but when i uploaded on my online server i got the errors. Now i made different variables for the path of the images and for the path used by the php code (relative path) and all turn out good. Again thx for the info Quote Link to comment https://forums.phpfreaks.com/topic/102498-solved-path-problem/#findComment-524903 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.