Professional Web Applications Themes

Dynamic menus - PHP Development

<?php include('./common_db.inc'); $link_id = db_connect(); mysql_select_db("test_db"); ?> <form name=carform action= <?php echo $_SERVER['PHP_SELF']; ?> method=post> <?php $query =mysql_query("select DISTINCT CQ_PROD_PLATFORM AS make_id from CQ_data ORDER BY make_id"); echo '<select name=make onchange="doent.carform.submit()"'.">"."\n"; if (!isset($make)) { echo '<option value=null selected>Choose a Make</option>'."\n"; } while(list($make_id) = mysql_fetch_row($query)) { echo '<option value='.$make_id; if (isset($make)&& $make_id == $make) { echo " selected"; } echo '>'."$make_id".'</option>'."\n"; } echo '</select>'."\n"; echo '<select name=model onchange="doent.carform.submit()"'.">"."\n"; if (!isset($make)) { echo '<option value=null selected>Choose a Make First</option>'."\n"; } else { $result = mysql_query("select DISTINCT CQ_SUBSYSTEM AS name from CQ_data where make_id='$make' ORDER BY NAME"); echo '<option value=null selected>Choose a Model</option>'."\n"; ...

  1. #1

    Default Dynamic menus

    <?php
    include('./common_db.inc');
    $link_id = db_connect();
    mysql_select_db("test_db");

    ?>

    <form name=carform action=
    <?php echo $_SERVER['PHP_SELF'];
    ?> method=post>
    <?php


    $query =mysql_query("select DISTINCT CQ_PROD_PLATFORM AS make_id from
    CQ_data ORDER BY make_id");
    echo '<select name=make
    onchange="doent.carform.submit()"'.">"."\n";
    if (!isset($make))
    {
    echo '<option value=null selected>Choose a Make</option>'."\n";
    }
    while(list($make_id) = mysql_fetch_row($query))
    {
    echo '<option value='.$make_id;
    if (isset($make)&& $make_id == $make)
    {
    echo " selected";
    }
    echo '>'."$make_id".'</option>'."\n";
    }
    echo '</select>'."\n";
    echo '<select name=model
    onchange="doent.carform.submit()"'.">"."\n";
    if (!isset($make))
    {
    echo '<option value=null selected>Choose a Make First</option>'."\n";
    }
    else
    {
    $result = mysql_query("select DISTINCT CQ_SUBSYSTEM AS name from
    CQ_data where make_id='$make' ORDER BY NAME");
    echo '<option value=null selected>Choose a Model</option>'."\n";
    while(list($model_id) = mysql_fetch_row($result))
    {
    echo '<option value=' . $model_id;
    if ($model_id == $model)
    {
    echo " selected";
    }
    echo '>$model_id</option>'."\n";
    }
    } echo '</select>'."\n";
    ?>
    Jim F Guest

  2. #2

    Default Dynamic menus

    I did not include my question in the previous message

    I have taken this from another example I saw of where one drop down
    list is dependent on the selection of the previous. I can't get the
    data to show up in the second menu after I select the first. Anyone
    see what I am doing wrong?

    Thanks, Jim

    <?php
    include('./common_db.inc');
    $link_id = db_connect();
    mysql_select_db("test_aces_data");
    ?>

    <form name=carform action=
    <?php echo $_SERVER['PHP_SELF'];
    ?> method=post>
    <?php


    $query =mysql_query("select DISTINCT CQ_PROD_PLATFORM AS make_id from
    CQ_data ORDER BY make_id");
    echo '<select name=make
    onchange="doent.carform.submit()"'.">"."\n";
    if (!isset($make))
    {
    echo '<option value=null selected>Choose a Make</option>'."\n";
    }
    while(list($make_id) = mysql_fetch_row($query))
    {
    echo '<option value='.$make_id;
    if (isset($make)&& $make_id == $make)
    {
    echo " selected";
    }
    echo '>'."$make_id".'</option>'."\n";
    }
    echo '</select>'."\n";
    echo '<select name=model
    onchange="doent.carform.submit()"'.">"."\n";
    if (!isset($make))
    {
    echo '<option value=null selected>Choose a Make First</option>'."\n";
    }
    else
    {
    $result = mysql_query("select DISTINCT CQ_SUBSYSTEM AS name from
    CQ_data where make_id='$make' ORDER BY NAME");
    echo '<option value=null selected>Choose a Model</option>'."\n";
    while(list($model_id) = mysql_fetch_row($result))
    {
    echo '<option value=' . $model_id;
    if ($model_id == $model)
    {
    echo " selected";
    }
    echo '>$model_id</option>'."\n";
    }
    } echo '</select>'."\n";
    ?>
    Jim F Guest

  3. #3

    Default Re: Dynamic menus

    Jim~

    I'm working on a similar problem with dependent dropdowns in php, and
    I'm curious if you ever figured out why your second menu wasn't
    populating? If you'd share your solution I'd be grateful. Thanks!
    steef Guest

Similar Threads

  1. XML Flash dynamic menus
    By Fido in forum Macromedia Flash Data Integration
    Replies: 0
    Last Post: January 4th, 09:07 AM
  2. div tag and dynamic menus
    By noobie2005 in forum Macromedia Dynamic HTML
    Replies: 3
    Last Post: June 6th, 03:19 PM
  3. learning (not to well) about Dynamic menus
    By AS Dawg in forum Dreamweaver AppDev
    Replies: 0
    Last Post: March 30th, 06:48 PM
  4. Dynamic navigation menus
    By jmoshier in forum Macromedia ColdFusion
    Replies: 0
    Last Post: February 17th, 01:01 PM
  5. Help with Dynamic Navigation / Menus
    By artboy1979 webforumsuser@macromedia.com in forum Macromedia Flash Sitedesign
    Replies: 0
    Last Post: July 15th, 06:16 PM

Bookmarks

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139