AardvarkBusiness.net - Business Search Engine AardvarkBusiness.net - Business Search Engine



 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

     

PHP question (how to create header and footer)

 
 
Post new topic   Reply to topic    AardvarkBusiness.net Forum Index -> Programming Forum
View previous topic :: View next topic  
Author Message
foundThroughAdminSig
President
President


Joined: 24 Apr 2004
Posts: 6491

7611 ants

PostPosted: Tue Aug 21, 2007 9:04 am    Post subject: PHP question (how to create header and footer) Reply with quote

I'm working on a new website and I realize that this is going to be a sizable website, though it won't be a humongous one that has over tens of thousands of pages. At this point, I'm thinking about creating header and footer separately like creating header.php, footer.php, header.tld and footer.tld. How do I go about this? Is there any tutorial on how to do this ...?
_________________
Online Education :: Training Forum
Chat about health ... Finance Books
Back to top
View user's profile Send private message Visit poster's website
Christian_SEO
Executive PA
Executive PA


Joined: 11 Dec 2003
Posts: 51
Location: Minneapolis MN USA
54 ants

PostPosted: Tue Sep 25, 2007 4:18 pm    Post subject: PHP Includes Reply with quote

You may have found the answer to your question, but if not here is a big hint:

You can use "includes" to do what you want. Just create your header in a file, and then put in the following code where you want the header to appear:
Quote:
<?php
include 'header.php';
?>
The web server will pull in the file and make it part of each web page. A change to the include file changes them on all pages of the site.

If you need more information you can search for things like "php includes" and you should find plenty of information.
_________________
http://www.Mesothelioma-Search-Engine.com
http://www.Mesothelioma-Lung-Cancer.org
http://www.AvandiaSearch.com
Back to top
View user's profile Send private message Visit poster's website
gamer1
Executive PA
Executive PA


Joined: 26 Jul 2007
Posts: 75

0 ants

PostPosted: Wed Sep 26, 2007 2:51 am    Post subject: Reply with quote

Yes, I agree with Christian's answer. That's the way to do it.
_________________
WIInnipeg.ca - The self proclaimed offical forum for Wii gamers in Winnipeg.
Back to top
View user's profile Send private message
Neilson
President
President


Joined: 27 Oct 2004
Posts: 589
Location: FL
695 ants

PostPosted: Fri Sep 28, 2007 10:04 pm    Post subject: Reply with quote

I work mainly with ASP.net 2.0 which has an awesome feature called Master Pages - When you create a master page, that page is used as a template for pages within your website so when you change the master page it updates each page that uses that page. Some guy created a PHP work around to create Master Pages in PHP here - http://spinningtheweb.blogspot.com/2006/07/approximating-master-pages-in-php.html


I'd take a look at that!
_________________
AOSEP - SEO Forum
Back to top
View user's profile Send private message Visit poster's website
Christian_SEO
Executive PA
Executive PA


Joined: 11 Dec 2003
Posts: 51
Location: Minneapolis MN USA
54 ants

PostPosted: Fri Sep 28, 2007 11:44 pm    Post subject: Includes and master pages Reply with quote

Hmmm. I was already to hate that idea, but in looking more closely, I see that it does make sense.

Instead of having content pages that use includes for header, navigation, sidebar, and footer, you have one include and then have your content pages call it....!

I moght have to try this at some point. Thanks!!!
_________________
http://www.Mesothelioma-Search-Engine.com
http://www.Mesothelioma-Lung-Cancer.org
http://www.AvandiaSearch.com
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    AardvarkBusiness.net Forum Index -> Programming Forum All times are GMT + 1 Hour
Page 1 of 1

 
Google
 
Business Forum Sport Forum Travel Forum


Powered by php B B © 2001, 2002 php B B Group

AardvarkBusiness.net Business Search Engine & Directory