Jump to content

Foolish but simple question


karthikeyan_coder

Recommended Posts

hello,
        i like to insert a html file in all of my html pages..

html file:
http://somedomain.com/footer.html

I like to insert it in
http://someotherdomain.com/page1.html
http://someotherdomain.com/page2.html

We can do it in php by [code]<?php include('http://somedomain.com/footer.html'); ?>[/code]

But how should i do it in HTML?

I got this code by googling
[code]<!--#include virtual="insertthisfile.html" -->[/code]

It doesnt seems working... :(
Can you help me?

Thank you,
KarthiKeyan
Link to comment
https://forums.phpfreaks.com/topic/29129-foolish-but-simple-question/
Share on other sites

look, here is a little example:

test.shtml
[code]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
  <head>
      <title>Untitled</title>
  </head>

  <body>
      <!--#include file="somepage.html"-->
      <br/><br/>
      another SSI command:
      <br/><br/>
      test.shtml last updated on:
      <br/>
      <!--#flastmod file="test.shtml" -->
  </body>
</html>
[/code]

somepage.html
[code]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

<html>
  <head>
      <title>Untitled</title>
  </head>

  <body>
      hello from somepage.html
  </body>
</html>
[/code]

the page you want to include it in has to be .shtml not .html if that doesn't work then your host probably has SSI disabled and you are gonna have to go the .php include route (or similar)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.