| Home | Register | FAQ | Members List | Search | Today's Posts | Mark Forums Read |
|
|
#1 (permalink) |
|
Accurate
Join Date: Feb 2003
Location: UK
Posts: 1,311
|
Is the right way to lay out a website?
Until now, I have layed out a website as below. Each page would consist like: include header content would go in here include footer Now, I've been told that I should have the content as an include aswel? Is this the right way to do things? Cheers. decent web hosting - www.balue.com
. |
|
|
|
|
|
#3 (permalink) |
|
Sir digby chicken caesar
Join Date: Sep 2004
Posts: 5,295
|
I get the feeling you don't mean an include at all... but are talking about building a dynamic website? Afterall, thats what you will end up with if you have an empty template pulling data in for every element. Doing it with includes at this stage would be pointless. |
|
|
|
#4 (permalink) |
|
Spare Parts
Join Date: Jan 2005
Location: Bracknell Forest
Posts: 5,118
|
I tend to build a body with top, menu, content and bottom then when I am happy with the design I change only the content to an include. See my current project http://www.epsweb.co.uk/pearsons/indexcss.php |
|
|
|
#5 (permalink) |
|
Spare Parts
Join Date: Jan 2005
Location: Bracknell Forest
Posts: 5,118
|
I would use PHP code like this. <?php if(!$page){include("page1.htm");} elseif($page=="2"){include("page2.htm");} elseif($page=="3"){include("page3.htm");} elseif($page=="4"){include("page4.htm");} else{exit;} ?> While we are back on the subject of includes would the above be secure against code injection attacks being as it not open ended? |
|
|
|
#6 (permalink) |
|
Accurate
Join Date: Feb 2003
Location: UK
Posts: 1,311
|
Ok interesting... so thats the right way to do it, but not includes. Ok thanks. decent web hosting - www.balue.com
. |
|
![]() |