Forum Moderators: coopster
You can use the php include function [php.net]
it would look something like this if you wanted to include a file in the same dir as the page calling it.
<?
include "somefile.html";
?>
You then place the include code in there making sure the path to the included file is correct no matter where on the site the page including it is located.
You could use
include $DOCUMENT_ROOT . "/somefile.html";
OR
include $DOCUMENT_ROOT . "/includedir/somefile.html";
makes the path absolute so that it won't break.
new file with header and body tags
nope, php will take the content in the included file and put it into the other page as is. Only put the code to be included in there. You don't need anything extra. Look at the source through a browser once the include is in there and you will see more what I mean.
Take a look at this
[httpd.apache.org...]