How do I include a separate page (modular)

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
bradles
Forum Commoner
Posts: 89
Joined: Wed Jun 30, 2004 10:40 pm

How do I include a separate page (modular)

Post by bradles »

If I have a header for my site with my logo on it that is one table 60px high and 100% wide and call it "header.php" can I include that on my index.php script so that whenever I change the header.php it will update on all my pages that include this? If so, how do I do this? I was sure I came across a website tutorial about writing modular scripts like this but can't find it again.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

[php_man]include[/php_man]
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

Code: Select all

<?
include("header.php");
echo 'Here comes the index ... ';
?>
EDit: To late lol..
bradles
Forum Commoner
Posts: 89
Joined: Wed Jun 30, 2004 10:40 pm

Post by bradles »

thank you both.

Does this mean I can include .html files as well as .inc and .php?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

yep
bradles
Forum Commoner
Posts: 89
Joined: Wed Jun 30, 2004 10:40 pm

Post by bradles »

awesome...thanks feyd.
Post Reply