Search Help Board

PHP FAQ
PHP Articles
PHP Help
Bulletin Board

PHP Manual (NEW!)
First Time PHP'ers
Help with programming
Sql assignment help
PHP Homework Help


C# Help
RFP Direct

 
 Right and Left Menus With Includes
Author:  (---.client.bresnan.net)
Date:   02-21-04 18:37

I got my includes to work, but I am trying to get my documents to include my right and left navigation menus with my document. I can get them to appear, but they load in order, one above the other with the main document below. I don't know how to get the correct placement (right on the right, left on the left with the document in the center.)

Any ideas?

Thanks

 Re: Right and Left Menus With Includes
Author:  (---.tnt1.hot-springs.ar.da.uu.net)
Date:   02-22-04 07:03

if your using tables you will need to define them more
<table align=left>
or
<table align=top or bottom or middle or right or center...



<head>
<? include('settings.php'); ?>
<title><? echo $pagetitle; ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<? include('mystyle.php'); ?>

</head>

<body>

<?

include('top.php');
include('menu.php');
include('news.php');
?>



</body>



in what i just showed you the top menu is my banner at the top (i have <table align=top there
then the menu is on left <table align=left...news is in the middle..

 Re: Right and Left Menus With Includes
Author:  (---.cpe.net.cable.roger)
Date:   02-22-04 07:13

or use divs

<body>


div id=top style="position:aboslute; top:0; left0;width:750;height:50;"
<?include('top.php');?>
</div>

<div id=left style="position:aboslute; top:50; left0;width:50;height:650;"

<? include('menu.php');?>
</div>

<div id=main style="position:aboslute; top:50; left50;width:500;"

<?include('news.php');?>
</div>
?>



</body>

 Re: Right and Left Menus With Includes
Author:  (---.client.bresnan.net)
Date:   02-22-04 15:21

Hmm. No matter what I do, the main document (news.php) shows below the left menu i.e.

top

left

news

As though it was left0; top:650 not left50; top:50. The width of news is at 500 but the rest isn't working.

What am I doing wrong?

Thanks

 Re: Right and Left Menus With Includes
Author:  (---.cpe.net.cable.roger)
Date:   02-22-04 17:10

Could you post the code. My mindreading skills aren't what they once were...

 Re: Right and Left Menus With Includes
Author:  (---.client.bresnan.net)
Date:   02-22-04 18:24

well. It's almost identical to the one you posted.

This is the body of the test php file is used (index.php):

<body>
<div id=top style="position:aboslute; top:0; left0;width:750;height:50;"
<? include('top.php') ?>
</div>
<div id=left style="position:aboslute; top:50; left0;width:50;height:650;"
<? include('left.php') ?>
</div>
<div id=main style="position:aboslute; top:50; left50;width:500;"
<?include('alaqsa_1.php');?>
</div>

Where alaqsa_1.php was a word document exporte to .htm then renamed to .php

left.php is the left navigation menu. The body of it is:

<body bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#800080" alink="#ff0000" bgproperties="" scroll="yes">
<ul>
<Li><a href="main.html">HOME</a>
<br>
<br>
<Li><a href="issues.html">ISSUES</a>
<br>
<br>
<Li><a href="articles.html">ARTICLES</a>
<br>
<br>
<Li><a href="HD_mission_1.htm">ABOUT US</a>
<br>
<br>
<Li><a href="Contacts.html">CONTACT US</a>
</ul>
</body>

I'm confused -- it appears as though it should work.

Thanks

 Re: Right and Left Menus With Includes
Author:  (---.ym.rnc.net.cable.rogers.com)
Date:   02-23-04 16:46

Well a couple of things with your code

1. the closing ">" tag was missing from each div tag

2. its ABSOLUTE not aboslute

here it is with colors to make it obvious

<body>
<div id=top style="position:absolute; top:0; left0;width:750;height:50; background-color:yellow;" >
<? include('top.php') ?>
</div>
<div id=left style="position:absolute; top:50; left0;width:50;height:650; background-color:green;" >
<? include('left.php') ?>
</div>
<div id=main style="position:absolute; top:50; left:50;width:500;height:650; background-color:blue;" >
<?include('alaqsa_1.php');?>
</div>
</body>

 Re: Right and Left Menus With Includes
Author:  (---.client.bresnan.net)
Date:   02-23-04 17:26

Ahh! Syntax. Yes, this worked. The color idea is great, it lets me see if I need to make adjustments. And with a couple minor adjustments it worked fine.

I just realized I had installed PHP Coder with an IDE that probably would have caught my syntax errors if I had used it.

Thanks allot for your time. I think I need to buy a more advanced PHP book.

 Re: Right and Left Menus With Includes
Author:  (---.client.bresnan.net)
Date:   02-23-04 18:36

I ran into another problem. After vewing it on one machine at 800x600, it looked quite differnt at 1024x768 on another machine (the whole layout was up against the left.) If there was a way to get the whole layout centered, I could live with that. I tried "relative" but that didn't work. I'll experiment some.

Any ideas?

Thanks

 Re: Right and Left Menus With Includes
Author:  (---.cpe.net.cable.roger)
Date:   02-23-04 19:14

This is the problem with Divs and absolute positions. you can try using JS to detect the screen size and then adjust the placement of the divs dynamically.

It is problematic and you need to decide what screen sizes you are gonna support. One neat trick here is to create a CSS style sheet that holds the positions and colors of the divs and then use JS to get the size and pull down the correct css...

I'll email you an article on divs

hth

 Re: Right and Left Menus With Includes
Author:  (---.client.bresnan.net)
Date:   02-23-04 19:49

Thanks.

Go to Top  |  Go to Topic  |  Threaded View  |  Search 
  |  
New Topic
 Reply To This Message
 Your Name:
 Your Email:
 Subject:
Email replies to this thread, to the address above.
  

Provided By
Phorum