Forum Moderators: mack
From my past in HTML I know I could do this using frames or iframes, but to tell you the truth I dislike them a great deal.
Is there another way of doing it? Can I call code for the menu from another file which would update all pages?
Which language would I need to learn?
Any help would be grately apprechiated.
Harry
Is there another way of doing it? Can I call code for the menu from another file which would update all pages?
There sure is a way to do that in PHP, in ASP you use an include file run serverside.
I use MS FrontPage and plain HTML, in FP there is a feature called Include, so you just place the Include file in cell and build your pages using the "Save as" feature, very easy, very simple.
I'm quite sure most people here will encourage you to keep on learning PHP and will provide at method of using Include files in PHP.
Hope this helps, hang around and you will find the answer to allmost any question here at WebmasterWorld.
you would then ahve code like so
<?
include "/path/to/sidemenu.php";
?>
on every page.If your pages all presently presently have html extensions you could enable php parsing for html files by using .htaccess and putting something similar to this
AddType application/x-httpd-php .php .html
also see here
[httpd.apache.org...]
Another good thread for some ideas is
A dynamic site in 2 minutes [webmasterworld.com]
I tried
<?php
include ("http://somepage.com/blah.php");
?>
and
<?php
include "http://somepage.com/blah.php";
?>
and
<?php
include 'http://somepage.com/blah.php';
?>
and even tried the HTML
<!--#include virtual="http://somepage.com"-->
All of the above bring up the text of the page in the correct place but the page attempts to call all images from
http://mysite.co.uk/pictures/pic.jpg etc
instead of
http://somesite.com/pictures/pic.jpg
Help please. How do I make the pictures come from the other root file instead of it trying to get them from mine?
It builds the page up from the various HTML and content fragements scattered through all the text files. The page is then served to the browser.
The browser only sees raw HTML code and your content within that. The page looks no different to one that is a static page that could be served instead. the browser sees all the links as relative to the current page URL, not relative to the location of any of the HTML fragments, because the browser has no idea that the page is even made up of fragments.
Code your links as being relative to the main page location. Use the full URL if pages are offsite from the "main" part of the page.