...

View Full Version : div id wont work



glossee
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>

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

<?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?

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

glossee
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

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

http://inobscuro.com/tutorials/read/16/

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



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

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


everytime i click the link:
index.php?go=site
or
index.php?go=me

it always open the "home" page...

harsh789
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';



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum