SitePoint Sponsor

User Tag List

Results 1 to 10 of 10

Thread: include

  1. #1
    SitePoint Member
    Join Date
    May 2002
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    include

    Also, how do I do a include of one html file in another file. I thought putting it is as,
    <!--#include file="./top.htm"-->
    within the body tags would do. BUt that didnt seemed to work.
    Please advise.
    Thanks.

  2. #2
    + platinum's Avatar
    Join Date
    Jun 2001
    Location
    Adelaide, Australia
    Posts
    6,441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    <!--#include file="top.htm"-->

    or

    <!--#include Virtual="top.htm"-->

    depending on what you're using it for

  3. #3
    SitePoint Member
    Join Date
    May 2002
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ..

    Well both didnt work as I included them as it was in the <body> as well as outsid eth body tags.
    But I also didnt understand "dependign on what you are using it for bit"
    top.htm is basically a header which Iamtrying to include at the top of every page. I tried franes, it works, but I wanted to do it without frmaes as well.
    I am ok with using tables also, but I want to try it without frames.
    Please advise.
    Thanks.

  4. #4
    SitePoint Wizard Aes's Avatar
    Join Date
    Jun 2001
    Location
    Oklahoma
    Posts
    3,392
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Platinum is saying that you use file to include any files in the same directory as the calling file; virtual if you're including a file below the current directory of the calling file. You say it works in frames, but not on a regular page? That's odd. First make sure that you're using the appropriate method (file or virtual), and make sure that you're not attempting to call a file above the directory where the calling file resides.

    -Colin
    Colin Anderson
    Ambition is a poor excuse for those without
    sense enough to be lazy.

  5. #5
    SitePoint Wizard creole's Avatar
    Join Date
    Oct 2000
    Location
    Nashvegas Baby!
    Posts
    7,845
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Read this thread:
    http://www.sitepointforums.com/showt...threadid=22209

    It will give you quite a bit of information about using SSI.
    Adobe Certified Coldfusion MX 7 Developer
    Adobe Certified Advanced Coldfusion MX Developer
    My Blog (new) | My Family | My Freelance | My Recipes

  6. #6
    + platinum's Avatar
    Join Date
    Jun 2001
    Location
    Adelaide, Australia
    Posts
    6,441
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    And your host needs to have SSI installed... I would be surprised if they didn't though.

    Post the webpage here if you still have trouble

  7. #7
    SitePoint Member
    Join Date
    May 2002
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    still no luck

    and I think its becuas ethe ssi is not installed. Another verification is that when I try to open a .shtml file in the browser it displays the contents of the file and when I view the source of the samefile.htm it shows the <!-- include statement --> in the file meaning that it was not able to intrepret it as a ssi but as a comment.

    You can see the webpage at,
    http://calamity.giccs.georgetown.edu/temp/
    the temp directory has these files,
    index.htm
    sample.htm
    top.shtml

    Lastly how do I install a ssi for a RH7.1 server, Apache webserver.

    Thanks.

  8. #8
    SitePoint Member
    Join Date
    May 2002
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    in the /apache_home/conf/httpd.conf

    There was a commented bit of .shtml which I uncommentd to look like this. But this still dont work.
    #
    # To use server-parsed HTML files
    #
    AddType text/html .shtml
    AddHandler server-parsed .shtml

    Please advise.

  9. #9
    SitePoint Member
    Join Date
    May 2002
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    gotcha !!

    It woks now, but I now have to rename all files as .shtml now. The file that is being included and the file including both have to .shtml
    Is that the case or am I missing something.
    Thanks.

  10. #10
    SitePoint Member
    Join Date
    May 2002
    Posts
    19
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Thumbs up got that fixed as well

    thanks


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
  •