Announcement

Collapse
No announcement yet.

How do I include a file using ServerSide Includes?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • How do I include a file using ServerSide Includes?

    Q. How do I include a file using ServerSide Includes?

    A. You need to have the main file index.shtml to have the shtml extension. then on the files you include you don't need the <html><body> tags. The Menu file can be any extension you want.

    index.shtml
    <html>
    <head>
    <title></title>
    </head>
    <body>
    <table>
    <!-- #include file="menu.txt" -->
    <td></td>
    <td></td>
    </tr></table>
    </body>
    </html>

    menu.txt
    <tr>
    <td>
    <p><a href="link1.html>link 1 </a></p>
    <p><a href="link2.html>link 2 </a></p>
    <p><a href="link3.html>link 3 </a></p>
    <p><a href="link4.html>link 4 </a></p></td>
    Have a Script or Snippet you want to share?

    WWW Standards: HTML 4.01,
    HTML 5, CSS2.1, CSS3, XHTML 1.0
    PHP Standards: PHP Standards

  • #2
    My SSI arent working but in the root...

    if your SSI pages are not showing but on your homepage, try this...

    address them virtually with (this style of include works on most NT / IIS 4 servers)
    <!--#include virtual="footer.html"-->

    depending on the servers configuration this might take some time, as it may require an additional / and or ..

    <!--#include virtual="/footer.html"-->
    <!--#include virtual="../footer.html"-->

    Starting simple with a few test pages on the server is the best way to adapt your site and yourself to how the SSI is configed on your server.

    chris<pixelmonkey>

    Comment


    • #3
      Then once you have mastered SSI, you can write programs that will write stuff from forms to your included file, and then you have a message board that will keep your webpage layout exactly the same!

      Comment

      Working...
      X