LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 08-05-2005, 03:31 PM   #1
MaTrIx709
Member
 
Registered: May 2004
Location: UK
Distribution: Debian Testing
Posts: 70

Rep: Reputation: 15
HTML for semi-static content?


Hope its ok to ask a html question in this forum.

I know some basic HTML and want to create a fairly decent webpage. I'm thinking somthing like a portal, but a photo gallery and linux tips etc.

I've done this very easily in the past with frames, but the more I learn, the more I realise frames suck. I can handle tables somewhat.

With tables, I end up having to copy and paste the navbar code into every page. This is obviously bad (one link change will have to be edited on every page).

My solution is to create a seperate php page for the navbar code, then use an include tag in each of my pages.

Is this the best solution?
 
Old 08-05-2005, 03:40 PM   #2
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
Yeah, that's what I do. Well, I don't use a PHP page for the bar itself, because there's no need (since it's just really for some links). I use a normal HTML file and include that, ie. include 'bar.htm'.
 
Old 08-05-2005, 03:55 PM   #3
MaTrIx709
Member
 
Registered: May 2004
Location: UK
Distribution: Debian Testing
Posts: 70

Original Poster
Rep: Reputation: 15
Cool, so atleast someone else also does this, a bit of a relief. I see your point about the navbar being straight html, I'll change this


This is what I do overall.



1) create a navbar page
2) create the top part of the table ---which has <?php include("navbar.php"); ?>
3) create the bottom half of the table


for each of the pages I do this.


Code:
<?php include("top.php"); ?>
add-some-content
<?php include("bottom.php"); ?>
the two halves of the table form valid html and they contain static layout stuff. Leaving me free to add content with ease.
 
Old 08-07-2005, 06:02 AM   #4
eddiebaby1023
Member
 
Registered: May 2005
Posts: 378

Rep: Reputation: 33
But please don't use table to format the page - do it properly with divs and CSS. Tables are great for tabular data, but not page layout. If you've ever compared proper CSS pages with those with masses of embedded table tags, you'll be an immediate convert (I know I was!).

I'm not sure you can rely on all browsers supporting the include directive, though, so it may be preferable to do it server-side.

Last edited by eddiebaby1023; 08-07-2005 at 06:04 AM.
 
Old 08-07-2005, 06:07 AM   #5
Nylex
LQ Addict
 
Registered: Jul 2003
Location: London, UK
Distribution: Slackware
Posts: 7,464

Rep: Reputation: Disabled
I need to learn about CSS and div tags myself, cos right now I'm using tables. He is doing it server-side, as PHP runs on the server and then sends HTML back to the client.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
use CGI vs. content-type: text/html johnensd Red Hat 0 05-10-2004 12:55 AM
how to replace html-file-content ??? ledauphin Linux - Newbie 2 03-08-2004 05:37 PM
Evolution spam filtering of HTML content andrewstr Linux - Software 5 12-19-2003 05:01 PM
set content-type to 'text/html' in sendmail, using perl script brokenfeet Programming 3 08-05-2003 03:12 PM
looking for help (css, html, graphics) ; content managing systems markus1982 General 8 06-24-2003 06:56 AM


All times are GMT -5. The time now is 12:07 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration