Welcome to WebmasterWorld Guest from 188.8.131.52
Forum Moderators: open
There are several ways, but they all boil down to an "include" page. Includes can be done using editors such as FrontPage and Dreamweaver, or .asp or .php, or .shtml, which ae server side, or webbot include which is user side.
What kind of set up do you have: files extensions and server type?
You'll have to change you .html extension to .shtml. Where you want the inlcude to appear, place this code:
<!--#include virtual="/path_relative_to_site.html" -->
<!--#include file="exact_path_to_file.html" --> (exact_path_to_file would have to be adjusted for every page)
Be careful though, your links may not and probably won't adjust for file location so all your hyperlinks in the include page should be absolute, not relative. Also, this type of include will include the ENTIRE page, so there is no need for duplicate certain tags in the include page:
Doctype<html><head>meta tags, title, rel links, etc. </head><body></body></html>
In other words, the include page sshould just have the menu, or other content you want to include. Make sesne?
include ($_SERVER['DOCUMENT_ROOT'] . '/somefolder/menu.php');
This will works no matter where the location of the document is that is using the include, e.g if your including it in the file yoursite.com/index.php -or- yoursite.com/somefolder/index.php . Note the file has to have the .php extension that is using the include or you need to set your server to parse html pages as .php If you already have a lot of .html the latter is probably the better choice.
Just my .02 but .php is better because there is so much more you can do with it besides includes, skies the limit for all intents and purposes.