Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To Set Up Common Code in HTML 8

Status
Not open for further replies.

xyzuser

Technical User
Aug 13, 2008
96
US
Basic question. I have HTML code that is common to many pages. Naturally I want to use these as a common routine that is callable, so that when I change the common HTML code it gets picked up in each page (instead of chaning each page individually).

Where do I store this and how do I link to/call it? It's not CSS styles and it's not javascript (I know how to do those).
Thanks
 
That would be normal to break your standard pages into as many parts as necessary. Here is a section from one of my sites
Code:
<?php
$title='My Page Title';
include("header1.php"); // opens/closes <head>, uses $title to set page title and header, sets up CSS
include("lhc.php"); // includes menu stuff
include("rhchead.php"); // contains layout and header for main section
echo("<p> this is where the actual text for the first para goes</p>");
include("middlebit.php"); // standard centre block
echo("<p> this is where the actual text for the last para goes</p>");
include("footer.php"); // standard last block contains footer info, tidy up etc
?>

If you want the best response to a question, please check out FAQ222-2244 first.
'If we're supposed to work in Hex, why have we only got A fingers?'
Drive a Steam Roller
 
Thank you johnwm for confirming my understanding.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top