Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    Regular Coder
    Join Date
    Jun 2007
    Posts
    310
    Thanks
    86
    Thanked 3 Times in 3 Posts

    Includes Question

    Hi Guys,

    I have a quick question say I have site which contains:

    head.php
    footer.php
    left_menu.php
    right_menu.php

    and I have an index.php page in the top level of my website which calls these elements in, but then I have another page named sections.php in a folder named updates the same thing happens.

    Now take footer.php for example may have an image in it:

    Code:
    images/logo.jpg
    now that would work fine for index.php, but for updates.php the path would not work as the images logo would need to be specified as ../images/logo.jpg

    So how do people get around this. I know I could make all paths absolute, but there must be an easier way around this as this is surely a common problem?

    Thanks

    Chris
    Last edited by stfc_boy; 11-20-2007 at 06:31 PM.

  • #2
    Super Moderator Inigoesdr's Avatar
    Join Date
    Mar 2007
    Location
    Florida, USA
    Posts
    3,647
    Thanks
    2
    Thanked 406 Times in 398 Posts
    Use a path relative to your web root, such as "/images/logo.jpg". That way it will work on all pages, in any directory.

  • #3
    Senior Coder
    Join Date
    Jan 2007
    Posts
    1,648
    Thanks
    1
    Thanked 58 Times in 54 Posts
    Or use the BASE tag.


  •  

    Posting Permissions

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