Jump to content

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)
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.