SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    GRAPHIC DESIGNER visualkreations's Avatar
    Join Date
    Sep 2005
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Is there a way i can use includes with an absolute path

    Is there a way i can use an include with an absolute path so its something likes this


    <!--#include file="http://www.mysite.com/includes/file.html" -->

  2. #2
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,048
    Mentioned
    16 Post(s)
    Tagged
    3 Thread(s)
    If your server supports DOCUMENT_ROOT

    <?php define('ROOT',$_SERVER['DOCUMENT_ROOT']); ?>

    <?php include(ROOT.'/includes/file.html'); ?>

    If you mean as a href or src than you can use / which would be the root of your site. So for your example: /includes/file.html

  3. #3
    GRAPHIC DESIGNER visualkreations's Avatar
    Join Date
    Sep 2005
    Posts
    171
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    can this be done if im using .ASP ?

  4. #4
    SitePoint Wizard bronze trophy
    Join Date
    Jul 2006
    Location
    Augusta, Georgia, United States
    Posts
    4,048
    Mentioned
    16 Post(s)
    Tagged
    3 Thread(s)
    I'm sure it can be, but I know next to nothing about asp. The second example isn't dependent on the server language.

    <a href="/index.php">index</a>


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
  •