There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
Web Design & Development
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Internet & Networking > Web Design & Development >
Solved: How do set a page within a page


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
skibum35's Avatar
Member with 71 posts.
 
Join Date: Aug 2005
Location: Sydney, Australia
Experience: Beginner
17-Nov-2005, 04:29 AM #1
Solved: How do set a page within a page
Can someone help me.

I am trying to set up a website using a CSS layout with 3 columns, header and footer.

It will be a combination of client side and server side.

Could someone tell me how I can include a page containing say the header details onto the viewed page without having to code each individual page.

I have looked around everywhere and cannot find the answer.

Thanks.
php guy's Avatar
Computer Specs
Senior Member with 512 posts.
 
Join Date: Dec 2004
Location: Bowlaro Lanes, WA
Experience: That's Mr. Clueless to you
17-Nov-2005, 01:45 PM #2
By header details, do you simple mean the top of the page, or the actual meta header stuff? Either way, make a page called header.php(if using php), put all the header content in there, then include it at the top of the pages with
<?php include('header.php'); ?>
Or with asp,
<!--#include file="include.asp"-->
__________________
if($post) echo $signature;
skibum35's Avatar
Member with 71 posts.
 
Join Date: Aug 2005
Location: Sydney, Australia
Experience: Beginner
17-Nov-2005, 03:15 PM #3
Thanks for the reply php guy.

I was also thinking about using php, but how do I set out tables within php.

What I mean is that my banner is sliced and I was going to put it into a table as it includes nav buttons as well as images.

Same as the side columns. Was thinking that they would be tidier if in a table.

I know these are basic questions, but that is where my knowledge is at for the time being.
php guy's Avatar
Computer Specs
Senior Member with 512 posts.
 
Join Date: Dec 2004
Location: Bowlaro Lanes, WA
Experience: That's Mr. Clueless to you
17-Nov-2005, 04:20 PM #4
You just write it all the html in the include file as you would in a normal html page. For example, say you want a page like this,
HTML Code:
<html> <head> <title>My page</title> <script type="text/javascript" src="js.js"></script> </head> <body> <table><tr><td>Head</td><td>Sliced></td><td>Image</td></tr> <tr><td>Side bar stuff</td> <td colspan="2">Content
Bla bla bla bla</td></tr> <tr><td colspan="3">Some footer</td></tr> </table> </body> </html>
You could copy all the stuff above the content and put it in header.php, so header.php would look like this,
Code:
<html>
<head>
<?php echo $headstuff; ?>
</head>
<body>
<table><tr><td>Head</td><td>Sliced></td><td>Image</td></tr>
<tr><td>Side bar stuff</td>
<td colspan="2">
Then have the footer.php look like this,
Code:
</td></tr>
<tr><td colspan="3">Some footer</td></tr>
</table>
</body>
</html>
Then have the actual page look something like this,
Code:
<?php
$headstuff='<title>My page</title><script type="text/javascript" src="js.js"></script>';
include('header.php);
?>
Content
bla bla bla bla
<?php include('footer.php'); ?>
And make the $headstuff= what ever you want in the head, like stylesheets, js, metas, and what ever. Then make more pages like that, and then just change the content and he headstuff.

Now just edit the header.php and footer.php to what ever fits what you want.

I really hope that made sence.
__________________
if($post) echo $signature;
skibum35's Avatar
Member with 71 posts.
 
Join Date: Aug 2005
Location: Sydney, Australia
Experience: Beginner
18-Nov-2005, 02:38 AM #5
Thanks phpguy,

Sorry for not coming back sooner. Got called into work.

That has helped some. I will work through it now.

In the meantime, I'll include the page text that I want to use and will attach the stylesheet.

The borders etc have not been worked on yet, I want to be able to get it all working first and tidy it up later.



<html >

<title>Home</title>

<head>

<link rel="stylesheet" href="includes/pagelayout_1.css" type="text/css" media="all"></link>
<style type="text/css" media="all"></style>

</head>

<body>

<div id="outer">
<div id="header">Header</div>
<div id="left"><p>Left Content</p></div>
<div id="right"><p>Right content</p></div>
<div id="centrecontent"></div>
<div id="clearfooter">&nbsp;</div><!-- to clear footer -->
</div><!-- end outer div -->
<div id="footer"> -Footer -</div>

</body>

</html>
Attached Files
File Type: txt (pagelayout_1.css).txt (2.2 KB, 49 views)

Last edited by skibum35 : 18-Nov-2005 02:35 AM. Reason: Didn't like .css
zoetrope's Avatar
Junior Member with 1 posts.
 
Join Date: Nov 2005
Location: Brisbane, Australia
Experience: Intermediate
25-Nov-2005, 03:36 AM #6
That helped me anyway, and I wasn't even looking for a solution. Nicely explained, thank you.
Reply


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

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 Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 09:42 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.