More than one Html page.

Reply

Join Date: May 2007
Posts: 11
Reputation: siji44 is an unknown quantity at this point 
Solved Threads: 1
siji44 siji44 is offline Offline
Newbie Poster

More than one Html page.

 
0
  #1
Jul 1st, 2009
Hi,
I have designed one html page (home) with CSS. I have four more pages in html and want my heading and menus to be repeated. How should i do it? Do i have to write all the heading and menu contents in each of my pages or is there any other ways. Please help..

Thank you,
Siji
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 20
Reputation: drumichael87 is an unknown quantity at this point 
Solved Threads: 0
drumichael87 drumichael87 is offline Offline
Newbie Poster

Re: More than one Html page.

 
0
  #2
Jul 1st, 2009
You can use a PHP include, if you are using php. Create a file for your header and menus and name it something like header.php & menus.php. (they can be separate or together in one file) You can create one for your footer, too.

Then, on every page you want them, include them with php like this:
<?php include("header.php"); ?>
Your html pages need the .php extension for this to work.

Your page might look like this:
HTML and CSS Syntax (Toggle Plain Text)
  1. <html>
  2. <head>
  3. <title>Title</title>
  4. </head>
  5.  
  6. <body>
  7. <?php include("header.php"); ?>
  8. <p>SOME CONTENT</p>
  9. <?php include("menus.php"); ?>
  10. <p>MAIN BODY CONTENT
  11. ...
  12. ...
  13. </p>
  14. <?php include("footer.php"); ?>
  15.  
  16. </body>
  17. </html>

The header file might look like this:

HTML and CSS Syntax (Toggle Plain Text)
  1. <img src="LOGO.JPG" />
  2. This is our website slogan...

The footer might look like this:

HTML and CSS Syntax (Toggle Plain Text)
  1. <p>
  2. &copy;Copyright 2009 by My website.com
  3. </p>
  4. <p>
  5. contact us anytime!
  6. </p>
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 11
Reputation: siji44 is an unknown quantity at this point 
Solved Threads: 1
siji44 siji44 is offline Offline
Newbie Poster

Re: More than one Html page.

 
0
  #3
Jul 1st, 2009
thank you, ill try this.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 211
Reputation: macneato is an unknown quantity at this point 
Solved Threads: 18
macneato's Avatar
macneato macneato is offline Offline
Posting Whiz in Training

Re: More than one Html page.

 
0
  #4
Jul 1st, 2009
hi siji44,

Honestly, its only four pages, don't think you need to go php. simply repeat your header divs using the same classes and if you coded it right, once you change your classes, all your pages will be changed as well.

Easy stuff!
If this reply solved your problem, please add to my reputation and don't forget to mark this thread as solved.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,318
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 161
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: More than one Html page.

 
0
  #5
Jul 1st, 2009
Originally Posted by macneato View Post
Honestly, its only four pages, don't think you need to go php.
please ignore this advice,
plan on expansion,
plan on 100,000 pages, and the database to support them, and the design features to import a single css and javascript file, and to php/ssi/cgi/asp(your choice) include all the common code.

Do it now when it is four pages, and you dont have to come back in a month and rewrite 40, come back in six months to rewrite 400 or more, and decide what code can be common.

imagine for example Wikipedia without the includes, and backend, every page requiring Joe Public to hand code menus to millions of other pages, for a minor edit .....
Dont think anyone would like to make edits
( WikiPedia is chosen as a design model that works )
Last edited by almostbob; Jul 1st, 2009 at 4:49 pm.
Failure is not an option It's included free
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Join Date: Dec 2008
Posts: 117
Reputation: u8sand is on a distinguished road 
Solved Threads: 15
u8sand's Avatar
u8sand u8sand is offline Offline
Junior Poster

Re: More than one Html page.

 
0
  #6
Jul 1st, 2009
I also may recommend framesets. You can look into that, i recommend for almost all web programming: www.w3schools.com.
Last edited by u8sand; Jul 1st, 2009 at 11:05 pm.
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 16,146
Reputation: jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all 
Solved Threads: 530
Moderator
Featured Poster
jbennet's Avatar
jbennet jbennet is offline Offline
Moderator

Re: More than one Html page.

 
-7
  #7
Jul 1st, 2009
Frames are a bit clumsy, and lost of mobile browsers dont support them very well
If i am helpful, please give me reputation points.
Reply With Quote Quick reply to this message  
Join Date: Jun 2007
Posts: 211
Reputation: macneato is an unknown quantity at this point 
Solved Threads: 18
macneato's Avatar
macneato macneato is offline Offline
Posting Whiz in Training

Re: More than one Html page.

 
0
  #8
Jul 2nd, 2009
You are actually being quite ridiculous bob. Wikipedia is probably the worst example you could think of. It's like you telling him (in lame-mans terms) to build a factory, it can do EVERYTHING FOR YOU when he will only be manufacturing 5 products. Not every site grows exponentially.

If you planning on building a large site, i would recommend going CMS there are alot of open source solutions available. This will save you development time and templating is relatively simple.
If this reply solved your problem, please add to my reputation and don't forget to mark this thread as solved.
Reply With Quote Quick reply to this message  
Join Date: Jan 2009
Posts: 1,318
Reputation: almostbob has a spectacular aura about almostbob has a spectacular aura about 
Solved Threads: 161
almostbob's Avatar
almostbob almostbob is offline Offline
Nearly a Posting Virtuoso

Re: More than one Html page.

 
0
  #9
Jul 2nd, 2009
Originally Posted by macneato View Post
You are actually being quite ridiculous bob. Wikipedia is probably the worst example you could think of. It's like you telling him (in lame-mans terms) to build a factory, it can do EVERYTHING FOR YOU when he will only be manufacturing 5 products. Not every site grows exponentially.

If you planning on building a large site, i would recommend going CMS there are alot of open source solutions available. This will save you development time and templating is relatively simple.
I am, arent I...

Siji44, plan on some expansion,
There will always be a few more changes to make, additional pages
if you arent going to use some includes, make a template you can paste content into, with the head scripts appearance set
Failure is not an option It's included free
If at first you dont succeed, join the club
Of course its always in the last place you look, you dont keep looking after you find it

Please mark solved problems, solved
Reply With Quote Quick reply to this message  
Join Date: Jun 2009
Posts: 20
Reputation: drumichael87 is an unknown quantity at this point 
Solved Threads: 0
drumichael87 drumichael87 is offline Offline
Newbie Poster

Re: More than one Html page.

 
0
  #10
Jul 21st, 2009
I think everyone's opinion is valid. Give the person asking the question some information, and let him make his own informed decision!

=)
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC