SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Addict
    Join Date
    Jun 2005
    Posts
    286
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    path to an image that can work throughout the website...

    I am facing a very common problem.

    I have a php file placed in the directory "includes/". It is the header file that contains images.

    for the pages on the root I can include that file like "includes/header.php".

    I have another folder "ROOT/admin_panel/". Now I want to use the same header file in the pages in folder "admin_panel". But the problem is that in admin_panel folder the path to images in header.php will not work.

    IS THERE ANY WAY to set the path to images in such a way that this file could be included anywhere in my website.???
    [COLOR=SlateGray]
    Web Developer @ VeriQual

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2008
    Posts
    5,757
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    use an absolute url.
    http://example.com/path/to/foo.gif
    or url relative to the domain
    /path/to/foo.gif


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
  •