PDA

View Full Version : PHP menu on side rather than "stacking" on top?



jtesp
September 24th, 2003, 06:12 PM
Here's an example of what I'm talking about :
http://www.kvr-vst.com/

See how the menu is on the left side rather than along the top...I'm new to PHP and haven't been able to find any info on this. All I know how to do is "stack" header.php, main.php, and footer.php "on top" of eachother. How can I "stack" these side by side?

Here's the code I use to "stack" them:

<?php include ("header.php"); ?>
<?php include ("main.php"); ?>
<?php include ("footer.php"); ?>


Any help appreciated!
Thanks

awligon
September 24th, 2003, 10:29 PM
please elaborate...

If you are talking about the layout, you can...


<table>
<tr>
<td>
<?php include 'menu1.php'; ?>
</td>
<td rowspan=2>
<?php include 'otherContent.php'; ?>
</td>
</tr>
<tr>
<td>
<?php include 'menu2.php'; ?>
</td>
</tr>
</table>

... to produce a layout similar to that one. However, I'm not sure what you're getting at about 'stacking'

jtesp
September 24th, 2003, 11:42 PM
Yeah, I think you got what I meant. I just wasn't sure how easily PHP can be implemented into a table.
I would like 2 columns for the menu to be on the left, and the content to be on the right. And also have a single row spanning across the bottom for a footer.
I played around and got something working, but I don't think I'm doing it the "correct" way. I seem to get </head> errors within dreamweaver, but the page displays correctly in a browser.
Thanks!

awligon
September 24th, 2003, 11:54 PM
No problem, 99% of the design I do is using tables and css to display php files within a page. That's just how I get down.

jtesp
September 24th, 2003, 11:57 PM
Oh! I'm having problems with CSS to work within an embedded PHP page. Where do I define the CSS? For instance:
In my index.php I have header.php, content.php, and footer.php
I set text in my content.php using css (within the content.php file itself), but when I run the index.php, the text in the content.php is not formatted using the css i defined.
Do you know what I'm saying?
Thanks!

abzoid
September 25th, 2003, 12:04 AM
Use an external CSS file and link to it in the HEAD of index.php. It will then apply to everything loaded into index.php


<link rel="stylesheet" href="stylesheet.css" type="text/css">

jtesp
September 25th, 2003, 12:11 AM
Ahh, what a life saver! Thanks!

awligon
September 25th, 2003, 12:16 AM
As abzoid said, this is an advantage to using an index 'skeleton page' because you can apply the stylesheet to that page, and it applies to every page loaded into it since the php compiler just outputs html code. Therefore, it's really only one page when you get done. On another note, publishing then viewing the source of your webpage is an excellent way to kind of debug your php code once you get several layers deep.