Closing Doman Auctions
DNForum - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars
HomeRegisterMembershipsGetting StartedDomain Tools Domain EbooksSEO Software Domain Resellers Advertise

Go Back   DNForum - Domain Sales, Domain Forum, Domain Appraisals, Domain Registrars > Content Development > Website Development and Design Discussion > Coding/Programming/Languages
Register Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old 02-17-2005, 12:54 AM   #1 (permalink)
DNF Member
No Avatar
 
Last Online: Yesterday 04:35 PM
iTrader: (28)
Join Date: Mar 2004
Posts: 383
DNF$: 1,751
Location: Boston, MA


HTML/PHP advice needed.

I am wondering, what is the best way to design a website that has some areas of static content that show up on each page such as a site navigation menu or a page footer that contains a disclaimer and links? The information on the menu and footer would never change from page to page, only the rest of the page content.

From my understanding, I want to stay away from frames. So how would I go about doing this? Should I put the menu and footer in spererate php files and use includes on each page to call them in? Or is there another way to go about this. I just want to make sure I get most of this right so I don't have to 1 day open up 500 files just to make a minor change to the dislaimer or copyright info on each page.

Your help is greatly appreciated. Example are helpful if possible. Thanks.
__________________
NewsForum.com - General Discussion Forum
FightForum.com - MMA, Boxing, UFC, and More - Discuss Boxing and MMA.
guile is offline   Reply With Quote
Sponsored Ads
Old 02-17-2005, 01:16 AM   #2 (permalink)
DNF Regular
 
DNGeeks's Avatar
 
Name: Bruce
Last Online: 11-08-2009 12:15 AM
iTrader: (3)
Join Date: Jan 2005
Posts: 627
DNF$: 4,609
Location: Winnipeg Canada
Country:


Re: HTML/PHP advice needed.

Php includes for the header and footer are probably your easiest and fastest way to get this job done. You could have a 50,000 page site, 1 header, 1 footer and it's simple to change the layout/menu once and be done with it.

An example page is below. Page is named index.php

<!DOCTYPE><html><head><title>title goes here</title>
<? include('head.txt') ?>

put your body html here

<? include('foot.txt') ?>


head.txt would just contain the rest of your header, the main menu and opening tables etc.

foot.txt would contain the closing tables and bottom of your page.
__________________
http://www.pocketbikeforum.com - Pocketbikes
http://www.indexusupport.com - Support, mods, tips and databases
http://www.gowinnipeg.ca - Winnipeg online directory
DNGeeks is offline   Reply With Quote
Old 02-17-2005, 01:27 AM   #3 (permalink)
DNF Member
No Avatar
 
Last Online: Yesterday 04:35 PM
iTrader: (28)
Join Date: Mar 2004
Posts: 383
DNF$: 1,751
Location: Boston, MA


Re: HTML/PHP advice needed.

Thanks for the reply. I was thinking along those line but just wasn't sure. I guess I am confident enough to go mess around with it now. Wish me luck =)
__________________
NewsForum.com - General Discussion Forum
FightForum.com - MMA, Boxing, UFC, and More - Discuss Boxing and MMA.
guile is offline   Reply With Quote
Old 02-17-2005, 01:43 AM   #4 (permalink)
DNF Regular
 
DNGeeks's Avatar
 
Name: Bruce
Last Online: 11-08-2009 12:15 AM
iTrader: (3)
Join Date: Jan 2005
Posts: 627
DNF$: 4,609
Location: Winnipeg Canada
Country:


Re: HTML/PHP advice needed.

Good luck

One thing you may need to know, depending on your system you may have to include the path to the include. Try not to use the URL to the include however even though that may be easier. /home/username/public_html/folder/head.txt (or whatever your path is) is the best.
__________________
http://www.pocketbikeforum.com - Pocketbikes
http://www.indexusupport.com - Support, mods, tips and databases
http://www.gowinnipeg.ca - Winnipeg online directory
DNGeeks is offline   Reply With Quote
Old 03-03-2005, 06:38 PM   #5 (permalink)
Platinum Lifetime Member
 
C0113c70r's Avatar
 
Last Online: 11-23-2008 10:57 PM
iTrader: (2)
Join Date: Sep 2003
Posts: 127
DNF$: 810
Location: Mobile, AL (USA)


Re: HTML/PHP advice needed.

The first time I ever tried to create repeating elements in a web site, I really screwed up and used a JavaScript file. Since learning a bit of PHP, I'll never go back to the old way of doing things again.

Good luck.

--- C0113c70r
C0113c70r is offline   Reply With Quote
Old 03-03-2005, 06:52 PM   #6 (permalink)
Platinum Lifetime Member
 
Darren06's Avatar
 
Name: Darren
Last Online: 10-22-2009 06:07 PM
iTrader: (14)
Join Date: Sep 2003
Posts: 1,896
DNF$: 2,403
Location: California, US
Country:

Send a message via AIM to Darren06

Re: HTML/PHP advice needed.

Hi, I suggest using
<?php
include "file.php";
?>
instead as ) is not really needed.
__________________
Zend PHP5 Certified Engineer - If you have a great domain name let me be the one to develop it.
Darren06 is offline   Reply With Quote
Old 03-05-2005, 01:22 PM   #7 (permalink)
Platinum Lifetime Member
No Avatar
 
Last Online: 11-30-2005 08:32 PM
iTrader: (6)
Join Date: Feb 2005
Posts: 44
DNF$: 218


Re: HTML/PHP advice needed.

Include is definately the simplest, you could do a SSI if you have no other need for php.
A simple template engine is also an option, if you want to generate static pages
arnette is offline   Reply With Quote
Old 03-09-2005, 05:12 PM   #8 (permalink)
Platinum Lifetime Member
 
mikesherov's Avatar
 
Last Online: 10-26-2009 01:14 PM
iTrader: (44)
Join Date: Jan 2005
Posts: 462
DNF$: 10
Location: NY

Send a message via AIM to mikesherov Send a message via Yahoo to mikesherov

Re: HTML/PHP advice needed.

imho, the best way to have a PHP template so to speak is to make your repeatable page... name it "template.htm", and put "##content##" where you want the changing content to be.... then you can make each individual page as another file "aboutus.htm". Then on a PHP page you can do this:

Quote:
<?
echo str_replace('##content##',file_get_contents('about us.htm'),file_get_contents('template.htm');
?>
Viola... PHP (in 1 line) has now sucked the aboutus page into the space where ##content## is on the template page. You have now taken your first step towards proper templating and seperating your code from your design.
mikesherov is offline   Reply With Quote
Old 03-18-2005, 04:17 PM   #9 (permalink)
Domain Developer
 
cursal's Avatar
 
Name: Brian
Last Online: Yesterday 08:43 PM
iTrader: (34)
Join Date: Aug 2003
Posts: 1,768
DNF$: 28
Location: Oregon
Country:

Send a message via AIM to cursal Send a message via MSN to cursal Send a message via Yahoo to cursal

Re: HTML/PHP advice needed.

NIce tip mike, thanks
cursal is offline   Reply With Quote
Old 03-18-2005, 08:30 PM   #10 (permalink)
Platinum Lifetime Member
 
Darren06's Avatar
 
Name: Darren
Last Online: 10-22-2009 06:07 PM
iTrader: (14)
Join Date: Sep 2003
Posts: 1,896
DNF$: 2,403
Location: California, US
Country:

Send a message via AIM to Darren06

Re: HTML/PHP advice needed.

Ah mike that is not really a good way... just make it use an OOP template parser...
__________________
Zend PHP5 Certified Engineer - If you have a great domain name let me be the one to develop it.
Darren06 is offline   Reply With Quote
Reply


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

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Advice Needed - Been contacted by PI Firm siaver Domain Name Appraisal Discussion 29 04-19-2005 08:30 PM
How to protect your claim to domains? Advice needed! URGENT! Collector Domain Name Legal Issues 5 11-26-2004 08:48 AM
Used a copyrighted image :-( advice needed if possible laskos Domain Name Legal Issues 21 04-03-2004 09:16 AM
Advice Needed dotcom Adult Domain Appraisals and Adult Website Discussions 1 07-23-2003 12:30 PM
Proper Sound Advice Needed About .ltd.uk's DRPiNG Domain Name Appraisal Discussion 2 10-11-2002 06:49 AM


All times are GMT -5. The time now is 07:32 AM.
Copyright @2001-2009 DNForum.com