Including one HTML file in another

Discussion in 'HTML & Website Design' started by Keaton, Nov 22, 2009.

  1. #1
    Hi, how do I include one html page in another?

    So like the header and footer as pages and then put that in another to show them both? They are in different folders.

    Thanks.
     
    Keaton, Nov 22, 2009 IP
  2. theapparatus

    theapparatus Peon

    Messages:
    2,925
    Likes Received:
    119
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Not that I'm aware of. I just made the master file into a php one, redirected the *.html to the *.php version, and did an include of the second one when I had to do it.
     
    theapparatus, Nov 22, 2009 IP
  3. vinpkl

    vinpkl Active Member

    Messages:
    899
    Likes Received:
    8
    Best Answers:
    0
    Trophy Points:
    58
    #3
    Last edited: Nov 22, 2009
    vinpkl, Nov 22, 2009 IP
  4. Keaton

    Keaton Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I put
    <!--#include virtual="/home/keaton/public_html/header.html" -->
    in the file I want it to appear (which is :/members /index.html)

    Have I done that wrong because it doesn't work.:confused:

    Thanks.
     
    Keaton, Nov 22, 2009 IP
  5. theapparatus

    theapparatus Peon

    Messages:
    2,925
    Likes Received:
    119
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Check with your host. They may not allow for SSI. Some hosts don't as they're a bit of a security risk and add to the server load. (Which is why I didn't think of it.)
     
    theapparatus, Nov 22, 2009 IP
  6. Masteroa

    Masteroa Peon

    Messages:
    54
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Frames, I guess.

    Example:

    <html>
    	<head>
    	<title>Arties Haarmode - Papestraat 1a - Den Haag</title>
    	</head>
    <!-- frames -->
    <frameset  cols="*,800,*" border=0>
        <frame name="left" src="left.html" marginwidth="0" marginheight="0" scrolling="no" frameborder="0">
        <frameset  rows="*,130,470,*">
            <frame name="top" src="top.html" marginwidth="0" marginheight="0" scrolling="no" frameborder="0">
            <frame name="title" src="title.html" marginwidth="0" marginheight="0" scrolling="no" frameborder="0" noresize>
    
            <frame name="main" src="main.html" marginwidth="0" marginheight="0" scrolling="auto" frameborder="0">
            <frame name="bottom" src="bottom.html" marginwidth="0" marginheight="0" scrolling="no" frameborder="0">
        </frameset>
        <frame name="right" src="right.html" marginwidth="0" marginheight="0" scrolling="no" frameborder="0">
    </frameset>
    Code (markup):
     
    Masteroa, Nov 22, 2009 IP
  7. Keaton

    Keaton Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    Sorted now thanks everyone. I hadn't surrounded the include files in <html> tags, which I can do.

    Thanks.
     
    Keaton, Nov 22, 2009 IP