Jump to content
sairfan1

Common Header and Footer for all html pages.

Recommended Posts

Hi im working with html4, and xhtml, i want to add common header and footer of page, for example i want to create two html files for header and footer, and then i want to import/add it to all pages so that if i change header file, header of all pages will update. please note that my pages are static with .htm extension.thanksIrfan

Share this post


Link to post
Share on other sites
Hi im working with html4, and xhtml, i want to add common header and footer of page, for example i want to create two html files for header and footer, and then i want to import/add it to all pages so that if i change header file, header of all pages will update. please note that my pages are static with .htm extension.thanksIrfan
The only method I could actually recommend would be to use PHP.If your server supports server-side includes you could use those instead. Server-side includes look like an ordinary HTML comment. I'd have to look it up to remember the syntax.

Share this post


Link to post
Share on other sites

another option would be to write a javascript for each and simply add the script to the page where you wish the info to appear: e.g. for the footer/address

<script type="text/javascript">writeAddress();</script></body></html>

If you the create a standard (x)html page as a template with your doctype and header/footer info in javascripts, any change you make to a script will automatically appear in each page.

Share this post


Link to post
Share on other sites

that could possibly be devastating if the user has javascript disabled. With a server side include, the content will show regardless.

Edited by thescientist

Share this post


Link to post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...

×
×
  • Create New...