techquilla Posted January 10, 2003 Share Posted January 10, 2003 this has been bothering me for a while and i just couldn't figure out how they do it.... Most websites has a content bar to the left of their pages and this content bar appears on everysingle page.... What do they do so that a content can appear on every webpage and one you update it, all pages' content bar gets updated........ i'm not looking for frames, because they look ugly........so, is there another way to do it...? Link to comment Share on other sites More sharing options...
0 thingsforjason Posted January 10, 2003 Share Posted January 10, 2003 this has been bothering me for a while and i just couldn't figure out how they do it....Most websites has a content bar to the left of their pages and this content bar appears on everysingle page.... What do they do so that a content can appear on every webpage and one you update it, all pages' content bar gets updated........ i'm not looking for frames, because they look ugly........so, is there another way to do it...? a content bar, like a menu? most sites are probably using some server side scripting, where they code the content bar as a separate file and then just include it on every page they need it on. Link to comment Share on other sites More sharing options...
0 m0fo Posted January 10, 2003 Share Posted January 10, 2003 just use php and include the template for each page <?php include(menu.php); ?> Link to comment Share on other sites More sharing options...
0 techquilla Posted January 10, 2003 Author Share Posted January 10, 2003 just use php and include the template for each page<?php include(menu.php); ?> if i use php, won't the name of those pages become *.php? but i want it as html......is that possible...? Link to comment Share on other sites More sharing options...
0 Ricky Baby Posted January 10, 2003 Share Posted January 10, 2003 its gotta be server side if your that botherd about a html extension you can use *.phtml (is that still supported) tha basic of the page will still be html its just that php tells the server how to put the pages together Link to comment Share on other sites More sharing options...
0 blueghost Posted January 10, 2003 Share Posted January 10, 2003 you can use *.phtml (is that still supported) just get the server to parse .phtml files as php, you could even set it to do that for html files and save all the files with a html extension, but that may cause problems with normal html files? Link to comment Share on other sites More sharing options...
0 pringlex Posted January 10, 2003 Share Posted January 10, 2003 you could even set it to do that for html files and save all the files with a html extension, but that may cause problems with normal html files? I dont think it would - PHP will just scan over a file until it reaches the <?php ?> tags, anything outside of them is ignored. Link to comment Share on other sites More sharing options...
0 m0fo Posted January 10, 2003 Share Posted January 10, 2003 i guess you can also use javascript to do it: <script language="javascript" src="menu.js"></script> and then in your menu.js, have a whole bunch of: document.write("<b>hello world</b>"); Link to comment Share on other sites More sharing options...
0 techquilla Posted January 10, 2003 Author Share Posted January 10, 2003 are there pre-done scripts that i can use..? Link to comment Share on other sites More sharing options...
0 pringlex Posted January 10, 2003 Share Posted January 10, 2003 If all you want to do is create a menu bar that is common to all the pages in your site, then a ready-made script wouldn't really be necessary. Just put this: <?php include ("filename.html"); ?> in each page wherever you want the menu to appear, where filename.php is the name of the menu file that contains the menu. e.g: http://www.ukaskew.com/navbar.php is the menu bar that appears on all the pages of http://www.ukaskew.com/ , simply include()d in PHP. To make PHP parse all html files, put the following code in a file called .htaccess on your server. <Files "*.html"> ForceType application/x-httpd-php </Files> Hope this helps :) Link to comment Share on other sites More sharing options...
0 m0fo Posted January 10, 2003 Share Posted January 10, 2003 are there pre-done scripts that i can use..? i just quickly put this together... not the fanciest or anything... just wanted you have a general idea so you can make your own in your index.html <html><head><title>title</title></head& #62; <body> <table width="100%"> <tr> ?<td width="30%"> ? <script language="javascript" src="a.js"></script> ?</td> ?<td width="*"> ? <h1>hello</h1> ? blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah blah ?</td> </tr> </table> in a.js document.write("<table>"); document.write(&a mp;# 34;<tr><td><a href='./page1.html'>item 1</a></td></tr>"); document.write("<tr>< td><a href='./page2.html'>item 2</a></td></tr>"); document.write("<tr>< td><a href='./page3.html'>item 3</a></td></tr>"); document.write("<tr>< td><a href='./page4.html'>item 4</a></td></tr>"); document.write("</table>& amp; #34;); Link to comment Share on other sites More sharing options...
0 Tim Dorr Veteran Posted January 10, 2003 Veteran Share Posted January 10, 2003 if i use php, won't the name of those pages become *.php? but i want it as html......is that possible...? Why does that matter though? The only difference is the filename, and that it'll be parsed by php. There is no detriment to having php parse it... Link to comment Share on other sites More sharing options...
0 thingsforjason Posted January 10, 2003 Share Posted January 10, 2003 if i use php, won't the name of those pages become *.php? but i want it as html......is that possible...? Why does that matter though? The only difference is the filename, and that it'll be parsed by php. There is no detriment to having php parse it... maybe so it's all secretive and people think he's good at updating things on all the pages. :blink: :) Link to comment Share on other sites More sharing options...
0 Tim Dorr Veteran Posted January 10, 2003 Veteran Share Posted January 10, 2003 well, if you want to be secretive, look at http://bowbefore.us I made it so you can't even see the extensions :D Link to comment Share on other sites More sharing options...
0 john smith 1924 Veteran Posted January 10, 2003 Veteran Share Posted January 10, 2003 how did you do that tim? Link to comment Share on other sites More sharing options...
0 Tim Dorr Veteran Posted January 10, 2003 Veteran Share Posted January 10, 2003 it's a secret....wait, no, it's not. it's just mod_rewrite :) Link to comment Share on other sites More sharing options...
Question
techquilla
this has been bothering me for a while and i just couldn't figure out how they do it....
Most websites has a content bar to the left of their pages and this content bar appears on everysingle page....
What do they do so that a content can appear on every webpage and one you update it, all pages' content bar gets updated........
i'm not looking for frames, because they look ugly........so, is there another way to do it...?
Link to comment
Share on other sites
15 answers to this question
Recommended Posts