SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Thread: PHP includes

  1. #1
    SitePoint Member
    Join Date
    Sep 2003
    Location
    Shelton, CT
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP includes

    I am trying to use the include function to include a navigation weg page with some graphics. The we page is included but the graphics aren't. What am I doint wrong?

  2. #2
    Ding Fries are Done! inter4design's Avatar
    Join Date
    Mar 2003
    Location
    usa
    Posts
    386
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    show the problematic code please!
    DoesItMatter
    - anyone seen my underwear?

  3. #3
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Is your include file in a different directory?

  4. #4
    SitePoint Addict
    Join Date
    Dec 2001
    Location
    Market Harborough, UK
    Posts
    206
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Remember that when you include a file, the relative directory any references use is that of the parent. So if you have a file called index.php in your root, which includes a file in a sub directory (e.g. subdir/included.php) which in tern refers to a file called image.gif, the system will look for image.gif in root, not in subdir/

    This applies whether we are talking about browser loded includes (like images etc), or server ones (like more includes in PHP.

    Yes, I got caught by that one too!

    HTH
    Paul Simpson, BSc, MCNI, MCNE


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •