I could swear I found a solution for this years ago. But I haven't done this in so long. How do I create a piece of text, menu, etc. that will update and look the same in all web pages that invoke it? This would be useful so one wouldn't have to update all pages to make the same changes, say for a copyright or disclaimer. Also if I need to update the menu bar, I could do it in one shot instead of going through every page.
You could use an Iframe to load your content and have the menu and copyright on the static homepage. or you could use and include("copyright.php"); if your site uses php to load it into every page. or if you are really really creative you could use sed like this find . -name "*.php" -print | xargs sed -i 's/foo/bar/g' to find and replace a text string in multiple files I personally use the iframe method with no borders, but I have used the other two before. The last is handy for changing something on your whole website.
IFrames are not very recomended nowadays, so I'd just go for a PHP include. It's simple and gets the job done server-side and is usually just a line of code.
I would also recommend using the include function in PHP. All you would have to do is add the navigation to page e.g. nav.php and then in every page you want it to appear place the PHP function in place of the old navigation. You can also do this for other things such as term etc.
I and three of my friend have stated a website development and maintenance company.I and one of my friend are working as coder(PHP and Mysql)and rest of two are working as designer(HTML,CSS,FLASH,PHOTOSHOP).If you have any requirement in your own website or oher's website,please contact in our email id
Thanks. I'll use PHP then. BUt just to keep my links and page rankings, I can keep the HTML file extensions right? I thought I saw a code that lets us do this so we won't have to rename .htm's to .php's. Cool! Saves a lot of work! I like CSS but with hundreds of pages, it's hard to update!
You can do it with htaccess, so the server handls the .html as php's I don't remember it right now, but I'll post it if I find it.