Hi All,
I've been reading the Tutorials about "Making Templates with PHP and Include() -- by enygma" & have a few question.
when you write & build the header/footer.php file's do they need to be wraped with a php tag or something ?
i.e. file code below, save as header.php
<?php
<html>
<title>Test Template</title>
<body bgcolor="white">\
<img src="logo.jpg">
?>
Then when you include your header/footer files within your .php pages i.e. index.php as the code below:
<?include("header.php");?>
this is the sample content
<?include("footer.php");?>
could these files "header/footer" be placed within a folder i.e. <?include("foldernamehere/header.php");?>
Also how does the code within <head> tag work ? if I built a page that needs the code within the head for i.e. drop down menus from http://www.projectseven.com will the browers see the code to display the page right.
So I would end with following page code for index.php:
<html>
<head>
</head>
<body>
<?include("foldername/header.php");?>
this is the sample content
<?include("foldername/footer.php");?>
</body>
</html>
Thanks Rich
Tutorials Question
Moderator: General Moderators
no and yes
The included files does NOT have to be inside a <?php .. ?> tag.
It may contain whatever you want.
And yes, the included files may be in a different folder.
It may contain whatever you want.
And yes, the included files may be in a different folder.
- twigletmac
- Her Royal Site Adminness
- Posts: 5371
- Joined: Tue Apr 23, 2002 2:21 am
- Location: Essex, UK