View Full Version : div id wont work

06-13-2006, 06:45 PM
i've got a problem...
im trying to convert my iframe site to php include
i have 4 include:
- header
- sidebar
- main/content
- footer
so this is how its look like:

<?php include('header.php'); ?>

<div id="nav">
<?php include('sidebar.php'); ?>

<div id="content">
<?php include('home.php'); ?>

<?php include('footer.php'); ?>

everything went well, except the DIV ID part...its seems like it wont work, my css for those ID are:

#nav {
position: absolute; left: 204px; top: 360px; overflow:auto;}
#content {
position: absolute; left: 182px; top: 40px; overflow:auto;}

somebody can help me?

06-13-2006, 06:47 PM
Show us what the final output is.

06-13-2006, 06:54 PM
the code in final output is exactly like what i want but the position that i made in css didnt work,i mean...for example it should go further 182px from left but actually the php include is going all to the left which making my layout mess up...if i can PM you, i would give u the url

06-14-2006, 03:48 PM
oh, forget about the css...i found another easy tutorial...from here:


where do i did wrong with my php setting, mine is:

$go = $_GET['index']; /* gets the variable $page */
$index = array('home','site', 'me', 'plugboard');

if ($go) {
if(in_array($go,$pages)) {
$go = $index . '.php';
else {
echo 'Page not found. Return to
<a href="index.php">index</a>';
} /* if $page has a value, include it */
else {
} /* otherwise, include the default page */

everytime i click the link:

it always open the "home" page...

06-14-2006, 06:37 PM
seems problem in your $index and $page variable.

confirm that your form variable is $_GET['index']

$go = $_GET['index']; /* gets the variable $page */

here $index is array but in in_array you using $pages

if(in_array($go,$pages)) {
$go = $index . '.php';