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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • djsjm
    New Member
    • Nov 2008
    • 23

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

    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
  • dlite922
    Recognized Expert Top Contributor
    • Dec 2007
    • 1586

    #2
    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

    Comment

    • djsjm
      New Member
      • Nov 2008
      • 23

      #3
      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.

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Originally posted by djsjm
        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.

        Comment

        • Dormilich
          Recognized Expert Expert
          • Aug 2008
          • 8694

          #5
          Originally posted by Markus
          Foobar is just programming riffraff, used to explain different things. It/they have no real meaning.
          that's not quite correct, see RFC 3092

          Comment

          • Markus
            Recognized Expert Expert
            • Jun 2007
            • 6092

            #6
            Originally posted by Dormilich
            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.

            Comment

            • Dormilich
              Recognized Expert Expert
              • Aug 2008
              • 8694

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

              Comment

              Working...