Grow your CSS skills. Land your dream job.

dynamic content

  • # April 9, 2009 at 7:47 am

    i want to control my content by click menu such as i click home and content will show about home.
    please help me what should i do

    following is is my menu.php code

    <div id="menu">

    <div id="menumain">
    <?php
    include_once(‘config.php’);
    $result = mysql_query("SELECT * FROM page ");

    while($row = mysql_fetch_array($result))
    {
    ?>

    <a href="?pageid=<?php echo $row; ?>"><?php echo $row; ?> </a>

    <?php
    }

    ?>
    </div>
    </div>

    following is my index.php code
    <?php include_once(‘config.php’);?>
    <?php include_once(‘header.php’); ?>

    <?php include_once(‘menu.php’);?>

    <div id="content">
    <?php include_once(‘sidebar.php’); ?>

    <div id="maincontent">

    <!– include_once(‘config.php’);–>
    <?php

    if(isset($_GET))
    {
    $result=mysql_query("select content from page where id=’pageid’");
    echo ‘$result';
    }
    ?>

    </div>

    <div id="space"></div>
    </div>

    <?php include_once(‘footer.php’); ?>

    # April 28, 2009 at 1:22 pm

    I may be off base here, but given the last post of yours I read, it sounds like you want us to do the work for you. You obviously know some PHP and the sample code you gave basically has what you want; when you get a request with querystring pageid=5 you just want to pull out a different field from the database and since you already know how to get info from the database, that’s not the issue; in fact, I’m not really sure what the problem is.

Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

*May or may not contain any actual "CSS" or "Tricks".