karthikeyan_coder Posted December 1, 2006 Share Posted December 1, 2006 hello, i like to insert a html file in all of my html pages..html file:http://somedomain.com/footer.htmlI like to insert it in http://someotherdomain.com/page1.htmlhttp://someotherdomain.com/page2.htmlWe 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 Quote Link to comment https://forums.phpfreaks.com/topic/29129-foolish-but-simple-question/ Share on other sites More sharing options...
Azu Posted December 1, 2006 Share Posted December 1, 2006 I'm pretty sure that can only be done with php or some kind of frames.. Quote Link to comment https://forums.phpfreaks.com/topic/29129-foolish-but-simple-question/#findComment-133537 Share on other sites More sharing options...
karthikeyan_coder Posted December 1, 2006 Author Share Posted December 1, 2006 no i have to include other html files in a lot of "HTML" files... i need code in HTML Quote Link to comment https://forums.phpfreaks.com/topic/29129-foolish-but-simple-question/#findComment-133548 Share on other sites More sharing options...
.josh Posted December 1, 2006 Share Posted December 1, 2006 did you try changing your filename extension from .html to .shtml when you tried that SSI? Quote Link to comment https://forums.phpfreaks.com/topic/29129-foolish-but-simple-question/#findComment-133551 Share on other sites More sharing options...
taith Posted December 1, 2006 Share Posted December 1, 2006 you cant... you'd have to switch them to php ora another language... as html is "static"... Quote Link to comment https://forums.phpfreaks.com/topic/29129-foolish-but-simple-question/#findComment-133554 Share on other sites More sharing options...
.josh Posted December 1, 2006 Share Posted December 1, 2006 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) Quote Link to comment https://forums.phpfreaks.com/topic/29129-foolish-but-simple-question/#findComment-133562 Share on other sites More sharing options...
karthikeyan_coder Posted December 1, 2006 Author Share Posted December 1, 2006 ok let me to check SSI and turn it ON and check thanks for you reply... Quote Link to comment https://forums.phpfreaks.com/topic/29129-foolish-but-simple-question/#findComment-133577 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.