Jump to content

[SOLVED] path problem


Dathremar

Recommended Posts

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

Link to comment
Share on other sites

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?

 

Link to comment
Share on other sites

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 :(

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 ;)

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.