Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    New to the CF scene
    Join Date
    Jun 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy div id wont work

    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 Code:

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

  • #2
    Regular Coder
    Join Date
    Oct 2005
    Location
    Newberg, Oregon
    Posts
    252
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Show us what the final output is.

  • #3
    New to the CF scene
    Join Date
    Jun 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #4
    New to the CF scene
    Join Date
    Jun 2006
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    new problem

    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 Code:
    <?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...

  • #5
    Regular Coder
    Join Date
    May 2006
    Posts
    101
    Thanks
    0
    Thanked 1 Time in 1 Post
    seems problem in your $index and $page variable.

    confirm that your form variable is $_GET['index']
    Code:
        $go = $_GET['index'];    /* gets the variable $page */
    here $index is array but in in_array you using $pages
    Code:
              if(in_array($go,$pages)) { 
            $go = $index . '.php';


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •