../ not working for images pulled from within an include file – PHP

  php

Q(Question):

Hi guys!

I may be overlooking something dumb here…

For a series of subdirectories I put the masthead in as an include file, with ../ up to the directory above it. Problem is, it won’t pull the images unless I have a masthead file in every single one of numerous subdirectories. Way too much work to update and it seems like uneccessary duplicate files.

Can someone tell me… is there some reason with PHP that this won’t work?

~ Debbie

A(Answer):

don’t put the ../ in the image.

If you have file "foo.php" and need to include "bar.php", any images in "bar.php" need to have relative path as if they were in foo.php.

Images are not called server side, they are called by user’s browser. Experiment on the URL that you need for the images to work.

Dan

A(Answer):

hi Dan! I just popped back online to post that I figured out what I was doing wrong.

I have no idea what a foo is past a foo fighter… and the only bars I know about are the ones that card you at the door and come in the form of chocolate (I partake of neither!).

What did the trick was simply having a masthead for each of the levels of pages, and within each masthead, putting how many ever ../s before each image that it took to get the job done. 3 masthead files instead of about 100. Works for me!

=)

Nice to see somone is around while I’m being insane at 2 in the morning.

A(Answer):

I have no idea what a foo is past a foo fighter… and the only bars I know about are the ones that card you at the door and come in the form of chocolate (I partake of neither!).

Nice to see somone is around while I’m being insane at 2 in the morning.

Foobar is just programming riffraff, used to explain different things. It/they have no real meaning.

Glad you got it sorted, although I couldn’t make sense of the problem, but I have just got up.

A(Answer):

Foobar is just programming riffraff, used to explain different things. It/they have no real meaning.

that’s not quite correct, see RFC 3092

A(Answer):

that’s not quite correct, see RFC 3092

Wow, someone must’ve been bored to go through all that effort to give meaning to nothing.

A(Answer):

although my all time favourite is RFC 2324 – time for a coffee using HTCPCP/1.0

LEAVE A COMMENT