hello danifriends.
i'm developing my website with php and i want to make dynamic header, so i create i file header.php with logo and menu and the page had all html doctype and and head tag for link with css and js..., i include the header in my page using include(../header/header.php)
, and so i was thinking that i was going to have html doctype 2 time in every pages where i include header and the <head>
so i delete the doctype in header.php and <head>
after that i dont have any php error for include but the space of header when i include it is empty
chrisschristou
0
Posting Whiz
Recommended Answers
Jump to PostI think it should be
include ("../header/header.php");
. Also, keep in mind that if you include it that way, you need to make sure that the path is correct.
Jump to PostYou can also predefine the doctype and head tags in the current page and the load the contents of the inc.php files
Jump to Post
header.php
should only contain the code/mark-up that is for your menu, Thus nodoctype
, nohead
, nohtml
and nobody
tags, just only the relvant code/mark-up for you menu. Do you have it like that?
All 12 Replies
Aeonix
71
Posting Whiz
Gideon_1
15
Junior Poster
chrisschristou
0
Posting Whiz
Aeonix
71
Posting Whiz
chrisschristou
0
Posting Whiz
gentlemedia
803
Master Poster
chrisschristou
0
Posting Whiz
gentlemedia
803
Master Poster
chrisschristou
0
Posting Whiz
gentlemedia
803
Master Poster
Mann_Youth
0
Newbie Poster
chrisschristou
0
Posting Whiz
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.