Forum Moderators: phranque

Message Too Old, No Replies

including a navigation bar

         

scorpion

5:49 pm on Mar 15, 2003 (gmt 0)

10+ Year Member



Can someone point me to info on how to include a graphical navigation bar (consisting of a set of html code) on every page of an html file. What is a good, compatible simple solution? I do have access to PHP, HTML, but prefer a nonjavascript solution...

Thanks!

mack

5:58 pm on Mar 15, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



You could create a document called header.php and include this within each of your pages using the following snippet.

<?php
include ("header.php") ;
?>

scorpion

6:06 pm on Mar 15, 2003 (gmt 0)

10+ Year Member



sounds like a perfect solution, only thing is I want all my files to have extension .html instead of .php...is there an html construct for inclusion or no?

mack

6:15 pm on Mar 15, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Your page could still retain the extension html (I think) someone please correct me if im wrong! The only section that would take on the php extension woudl be the header.

so your header would be something like...

<?php
<html>
<head><title>foo</title>
</head>
<body>
<?php
//header.php
header content goes here
?>

the page code would be as follows.....

<?php
include ("header.php") ;
?>
<html>
standard html page here
</body>
</html>

Alternative Future

6:27 pm on Mar 15, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



[answer removed]

-gs

[edited by: Alternative_Future at 7:03 pm (utc) on Mar. 15, 2003]

scorpion

6:46 pm on Mar 15, 2003 (gmt 0)

10+ Year Member



<?php
include ("header.php") ;
?>
<html>
standard html page here
</body>
</html>

but this page cannot be .html since it has PHP coding in it?

Alternative Future

7:00 pm on Mar 15, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Oops :(

Just checked with one of my work colleagues that has his site done in PHP where I thought he had all his pages in *.html and you are correct server-side script does require .php! Sorry about that. Do you have access for using .htaccess in that case where each *.php can be disguised as *.html?

Once again sorry (valid lesson learned on assumption)

-gs

bohemian

4:36 pm on Mar 16, 2003 (gmt 0)

10+ Year Member



scorpion,

May I ask why you want to "all my files to have extension .html instead of .php"?

scorpion

5:23 pm on Mar 16, 2003 (gmt 0)

10+ Year Member



I don't know, do you think people are weary of .php files? Maybe they think they open onto blind links, redirects, etc...

Birdman

5:39 pm on Mar 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There is nothing wrong with PHP [php.net] file extensions, as far as I can tell. I just switched a 300 page site over to PHP [php.net] with no drop in serps.

However, if you add this line to your .htaccess file, all .html files will be parsed for PHP:


AddType application/x-httpd-php .php .php3 .phtml .html

aspdaddy

5:44 pm on Mar 16, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You could also check if .shtml works or (Gasp) use frames :)