The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

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">
    $result = mysql_query("SELECT * FROM page ");

    while($row = mysql_fetch_array($result))

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



    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’);–>

    $result=mysql_query("select content from page where id=’pageid’");
    echo ‘$result’;


    <div id="space"></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.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed