Bluepearl Design
Go Back   Bluepearl Design > Misc > Tutorials > PHP & MySQL

[PHP] Creating Headers and Footers

PHP 4 & 5 Hypertext Preprocessor
MySQL multi-user, SQL (Structured Query Language) Database Management System

    

Reply
 
LinkBack Thread Tools Rate Thread Display Modes
Old 01-15-2004, 07:02 PM   #1 (permalink)
 
Sean's Avatar
 
Title: Founder/Admin
Join Date: Jan 2004
Location: Sydney, Australia
Age: 28
Posts: 8,907
Images: 386
Blog Entries: 4
Rep Power: 10 Sean will become famous soon enough
Send a message via MSN to Sean Send a message via Skype™ to Sean
Thumbs up [PHP] Creating Headers and Footers

Including headers and footers from a page can save u alot of time and effort.

When u want to edit the header for example u only have to edit one file instead of 20+ depending on how many pages your site has.

For example your index.php or link.php will call upon the headers and footers like this.

index.php
PHP Code:
<?php require_once($DOCUMENT_ROOT '/header.php'); ?>
<hr>
<center>Web Content</center>
<hr>
<?php require_once($DOCUMENT_ROOT '/footer.php'); ?>
Then your headers and footers would look like this:

header.php
HTML Code:
<HTML>
<HEAD>
  <TITLE>Test Page</TITLE>

<LINK REL=stylesheet TYPE="text/css" HREF="styles.css">
</HEAD>

<body bgcolor="#00000"> 
Footer.php
HTML Code:
<p>Tutorial by Bluepearl Design
</BODY>
</HTML> 
As u can see this is very easy, and editing copyrights etc will take no time at all

U could also add menu's using this feature which would mean changing links would only mean changing one file instead of say 20+

example:
HTML Code:
<td width="100" class="menu"><?php require_once($DOCUMENT_ROOT . '/menu.inc'); ?></td> 
If u dont understand any this dont hesistate to ask

Last edited by Sean; 06-09-2005 at 04:43 AM.
Sean is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-07-2004, 04:03 PM   #2 (permalink)
 
Title: Banned
Join Date: Jan 2004
Location: Fort Lewis, WA
Age: 19
Posts: 59
Rep Power: 0 Infamous is on a distinguished road
Send a message via ICQ to Infamous Send a message via MSN to Infamous
Re: [PHP] Creating Headers and Footers

ok question would it be better to use a transparent iframe or to use
php and inclue the page or whateva?
Infamous is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-07-2004, 04:23 PM   #3 (permalink)
 
Sean's Avatar
 
Title: Founder/Admin
Join Date: Jan 2004
Location: Sydney, Australia
Age: 28
Posts: 8,907
Images: 386
Blog Entries: 4
Rep Power: 10 Sean will become famous soon enough
Send a message via MSN to Sean Send a message via Skype™ to Sean
Re: [PHP] Creating Headers and Footers

Depends on the design u r working on. I dont think Iframe transparency works in all browsers so i wouldnt use it.
Sean is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-07-2004, 04:44 PM   #4 (permalink)
 
Title: Banned
Join Date: Jan 2004
Location: Fort Lewis, WA
Age: 19
Posts: 59
Rep Power: 0 Infamous is on a distinguished road
Send a message via ICQ to Infamous Send a message via MSN to Infamous
Re: [PHP] Creating Headers and Footers

but is there really a different between using them besides the frame
might not be compatible?
Infamous is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-07-2004, 05:08 PM   #5 (permalink)
 
Sean's Avatar
 
Title: Founder/Admin
Join Date: Jan 2004
Location: Sydney, Australia
Age: 28
Posts: 8,907
Images: 386
Blog Entries: 4
Rep Power: 10 Sean will become famous soon enough
Send a message via MSN to Sean Send a message via Skype™ to Sean
Re: [PHP] Creating Headers and Footers

Personal choice i suppose.

On this Cosita's site for example this page

I used iframes and php header and footers.
As i am a good bloke i will show the source code click here

Last edited by Sean; 06-09-2005 at 04:41 AM.
Sean is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-07-2004, 05:09 PM   #6 (permalink)
 
Sean's Avatar
 
Title: Founder/Admin
Join Date: Jan 2004
Location: Sydney, Australia
Age: 28
Posts: 8,907
Images: 386
Blog Entries: 4
Rep Power: 10 Sean will become famous soon enough
Send a message via MSN to Sean Send a message via Skype™ to Sean
Re: [PHP] Creating Headers and Footers

its abit of a mess, but thats how it is when u code by hand :P
Sean is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-07-2004, 08:18 PM   #7 (permalink)
 
Title: Member
Join Date: Jan 2004
Location: Melbourne, Australia
Posts: 252
Rep Power: 5 Rebel is on a distinguished road
Send a message via AIM to Rebel Send a message via MSN to Rebel
Re: [PHP] Creating Headers and Footers

yeah looks good (the finished product that is)
Rebel is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-06-2008, 07:43 AM   #8 (permalink)
ICY
 
ICY's Avatar
 
Title: Ice God
Join Date: Jun 2004
Location: Canada
Age: 21
Posts: 2,123
Images: 14
Rep Power: 7 ICY is on a distinguished road
Send a message via AIM to ICY Send a message via MSN to ICY
Re: [PHP] Creating Headers and Footers

It would be better to use PHP includes for SEO reasons. I know allot of rank is lost when using frames because of having the seperate html pages, where as multiple php pages included witheachother, just looks like one page to a spiderbot
__________________
ICY is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-11-2008, 11:56 PM   #9 (permalink)
 
Sean's Avatar
 
Title: Founder/Admin
Join Date: Jan 2004
Location: Sydney, Australia
Age: 28
Posts: 8,907
Images: 386
Blog Entries: 4
Rep Power: 10 Sean will become famous soon enough
Send a message via MSN to Sean Send a message via Skype™ to Sean
Re: [PHP] Creating Headers and Footers

PHP includes means that u will get better code/content ratio with google as the html document will be calling upon other files for most of the repeated code.
Sean is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 10-14-2008, 02:47 PM   #10 (permalink)
ICY
 
ICY's Avatar
 
Title: Ice God
Join Date: Jun 2004
Location: Canada
Age: 21
Posts: 2,123
Images: 14
Rep Power: 7 ICY is on a distinguished road
Send a message via AIM to ICY Send a message via MSN to ICY
Re: [PHP] Creating Headers and Footers

Isn't that what I just said? :P
__________________
ICY is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


  
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
Bluepearl Templates

All times are GMT +11. The time now is 09:35 PM.

 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52