Forum Moderators: coopster & phranque

Message Too Old, No Replies

Header and Footer Includes

         

Acternaweb

3:24 pm on Sep 6, 2001 (gmt 0)

10+ Year Member



Where can I find header and footer includes for navigation. I know I have seen this countless times, but not that I am looking for it I can seem to find it.

THanks

Marcia

3:37 pm on Sep 6, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



With server side includes, the portion of code and text you want included are placed into a text file. In this case, header.txt and footer.txt- two of them.

Then it's:

<!--#include virtual="/header.txt" -->

<!--#include virtual="/footer.txt" -->

Place on the pages wherever you want the insert to appear (and the extra space belongs there at the end).

It'll usually be on .shtml pages, but on some servers you can get it to work for .html by putting this into .htaccess:

AddType text/html .html
AddHandler server-parsed .html

Is that what you were looking for?

Acternaweb

1:39 pm on Sep 7, 2001 (gmt 0)

10+ Year Member



That is very close, not sure if what I am looking for is possible. With in my navigation I have includes (breadcrumbs, time, etc). Is it possible to have an include that has an include with in it? Let me know if that makes sense to you.

Thanks,

GWJ

4:56 pm on Sep 7, 2001 (gmt 0)



Is it possible to have an include that has an include with in it?

Sure is. I have static web pages that use an include for my header. The include header contains my logo and other things. In this include page I have another include page for two search boxes. I've had no problems with compatibility with browsers on this either.

Brian

Acternaweb

7:55 pm on Sep 19, 2001 (gmt 0)

10+ Year Member



I can get the html to work, but when I have an included within the header, it does not show up. Any ideas?

Slade

9:55 pm on Sep 19, 2001 (gmt 0)

10+ Year Member



Do you get a server error? Or does the text you typed in show up on the resulting html page.

Also you need to see if you can use includes on .html pages, most systems default to .shtml, but this can be changed. Try renaming to .shtml and see if it works.

Acternaweb

12:53 pm on Sep 20, 2001 (gmt 0)

10+ Year Member



The script does not come up. I have tested the include (in the same directory) outside the header include and it works. It is when I have it an include within an include that it doesn't work. Does that make sense?

Brett_Tabke

1:07 pm on Sep 20, 2001 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



The includes that can include includes is a recent 1.3(?) switch in apache. Sure you are running that version?

Acternaweb

1:32 pm on Sep 20, 2001 (gmt 0)

10+ Year Member



The server is Apache/1.3.19 (Unix)
Any ideas on how to get it to work?

Thanks

grnidone

9:00 pm on Sep 23, 2001 (gmt 0)



If you are looking to include a file with PHP, the format is like this:

<? include("footer.txt")?>