Dynamic List/Menu Passing Variables

Ask a Question related to Dreamweaver AppDev, Design and Development.

  1. #1

    Default Dynamic List/Menu Passing Variables

    New to Dreamweaver. Using DreamWeaverMX 6.1. I am trying to create a page
    that the user can select an item from a drop down menu using Dynamic List/Menu
    and pass it onto another page that will pull up a the detail about that
    records. I've worked around this for days and the only variable it passes is
    the first item in the list, no matter which list is selected. Any help would
    be appreciated.........

    Code is as follows

    :confused;

    <?php require_once('../../Connections/IMH.php'); ?>
    <?php
    mysql_select_db($database_IMH, $IMH);
    $query_rsSumbit = "SELECT JobPostID, JobTitle FROM AppRecords";
    $rsSumbit = mysql_query($query_rsSumbit, $IMH) or die(mysql_error());
    $row_rsSumbit = mysql_fetch_assoc($rsSumbit);
    $totalRows_rsSumbit = mysql_num_rows($rsSumbit);
    ?>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body>
    <form name="form1" method="post" action="testapplicants.php?recordID=<?php
    echo $row_rsSumbit['JobPostID'] ?>">

    <select name="select">
    <?php
    do {
    ?>
    <option value="<?php echo $row_rsSumbit['JobPostID']?>"><?php echo
    $row_rsSumbit['JobTitle']?></option>
    <?php
    } while ($row_rsSumbit = mysql_fetch_assoc($rsSumbit));
    $rows = mysql_num_rows($rsSumbit);
    if($rows > 0) {
    mysql_data_seek($rsSumbit, 0);
    $row_rsSumbit = mysql_fetch_assoc($rsSumbit);
    }
    ?>
    </select>
    <input type="submit" name="Submit" value="Submit">
    </form>
    </body>
    </html>
    <?php
    mysql_free_result($rsSumbit);
    ?>

    DETAIL PAGE

    ?php require_once('../../Connections/IMH.php'); ?>
    <?php
    $colname_rsRecords = "1";
    if (isset($HTTP_GET_VARS['recordID'])) {
    $colname_rsRecords = (get_magic_quotes_gpc()) ? $HTTP_GET_VARS['recordID'] :
    addslashes($HTTP_GET_VARS['recordID']);
    }
    mysql_select_db($database_IMH, $IMH);
    $query_rsRecords = sprintf("SELECT * FROM AppRecords WHERE JobPostID = '%s'",
    $colname_rsRecords);
    $rsRecords = mysql_query($query_rsRecords, $IMH) or die(mysql_error());
    $row_rsRecords = mysql_fetch_assoc($rsRecords);
    $totalRows_rsRecords = mysql_num_rows($rsRecords);
    ?>
    <html>
    <head>
    <title>Untitled Document</title>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    </head>

    <body>
    <table border="1">
    <tr>
    <td>JobPostID</td>
    <td>JobTitle</td>
    <td>AppID</td>
    <td>AppName</td>
    <td>BeginWork</td>
    <td>ReferredBy</td>
    <td>ReferredByOther</td>
    <td>FullTime</td>
    <td>PartTime</td>
    <td>PartTimeNB</td>
    <td>Regular</td>
    <td>Temp</td>
    <td>Intermit</td>
    <td>Shifts</td>
    <td>USWorkStatus</td>
    <td>Convict</td>
    <td>ConvictDetails</td>
    <td>PrevApp</td>
    <td>PrevEmployed</td>
    <td>PrevEmpTime</td>
    <td>PrevEmpDept</td>
    <td>Relatives</td>
    <td>Signature</td>
    <td>SignatureDate</td>
    <td>DateSubmitted</td>
    </tr>
    <?php do { ?>
    <tr>
    <td><?php echo $row_rsRecords['JobPostID']; ?></td>
    <td><?php echo $row_rsRecords['JobTitle']; ?></td>
    <td><?php echo $row_rsRecords['AppID']; ?></td>
    <td><?php echo $row_rsRecords['AppName']; ?></td>
    <td><?php echo $row_rsRecords['BeginWork']; ?></td>
    <td><?php echo $row_rsRecords['ReferredBy']; ?></td>
    <td><?php echo $row_rsRecords['ReferredByOther']; ?></td>
    <td><?php echo $row_rsRecords['FullTime']; ?></td>
    <td><?php echo $row_rsRecords['PartTime']; ?></td>
    <td><?php echo $row_rsRecords['PartTimeNB']; ?></td>
    <td><?php echo $row_rsRecords['Regular']; ?></td>
    <td><?php echo $row_rsRecords['Temp']; ?></td>
    <td><?php echo $row_rsRecords['Intermit']; ?></td>
    <td><?php echo $row_rsRecords['Shifts']; ?></td>
    <td><?php echo $row_rsRecords['USWorkStatus']; ?></td>
    <td><?php echo $row_rsRecords['Convict']; ?></td>
    <td><?php echo $row_rsRecords['ConvictDetails']; ?></td>
    <td><?php echo $row_rsRecords['PrevApp']; ?></td>
    <td><?php echo $row_rsRecords['PrevEmployed']; ?></td>
    <td><?php echo $row_rsRecords['PrevEmpTime']; ?></td>
    <td><?php echo $row_rsRecords['PrevEmpDept']; ?></td>
    <td><?php echo $row_rsRecords['Relatives']; ?></td>
    <td><?php echo $row_rsRecords['Signature']; ?></td>
    <td><?php echo $row_rsRecords['SignatureDate']; ?></td>
    <td><?php echo $row_rsRecords['DateSubmitted']; ?></td>
    </tr>
    <?php } while ($row_rsRecords = mysql_fetch_assoc($rsRecords)); ?>
    </table>
    </body>
    </html>
    <?php
    mysql_free_result($rsRecords);
    ?>

    PapiYoni Guest

  2. Similar Questions and Discussions

    1. Passing Dynamic XML variables from CF Fusebox 3
      Oh help and thanks in advance! I am converting a standard CF site to a Fusebox 3 site (encorporating it into Fusebox). I am using a DW Flash...
    2. passing dynamic variables
      Am creating a video library using a database to store the url links to the videos - how do I pass a variable selection from one html page to another...
    3. Stumped on Dynamic List/Menu
      I keep posting hoping that someone will have an answer to this stumper: I want to show a product (wooden hanger) with one image, one name, and one...
    4. Passing the value of a Dynamic List
      Hi all - not sure what I am missing here, however I would like to pass the option value of my list to the desired URL within my on-change event. I...
    5. Multiple Dynamic List Menu Help
      Hello. I'm a programming novice and I'm trying to create a two dynamically populated list and or jump menus. I'd like there to be a parent / child...
  3. #2

    Default Re: Dynamic List/Menu Passing Variables

    Ok,

    On the first page, you have for the form action:

    <form name="form1" method="post" action="testapplicants.php?recordID=<?php
    echo $row_rsSumbit['JobPostID'] ?>">

    So the form submits to testapplicants.php?recordID = 24 for example. The
    recordID will always be the first one in the recordset. You need to remove
    this, and just have:

    <form name="form1" method="post" action="testapplicants.php">

    On the detail form, to read the variable youre using
    $HTTP_GET_VARS['recordID'], which read the record ID from the url, not from
    the actual form itself. Change this to:

    $HTTP_POST_VARS['select']

    Where select is the name of your dropdown, and it should work.


    --
    Gareth - TMM Dreamweaver
    [url]http://www.dreamweavermxsupport.com/[/url]
    [url]http://www.garethdp.com/[/url]

    PHP Login Suite V2 - 34 Server Behaviors to build a complete Login system.
    [url]http://www.phploginsuite.co.uk/[/url]

    Co-Author: Dreamweaver MX: Instant Troubleshooter - Apress
    Co-Author: Practical Intranet Development - Apress
    Co-Author: Dreamweaver MX: Advanced PHP Web Development - Apress
    Co-Author: Dreamweaver MX: PHP Web Development - Wrox


    gareth Guest

  4. #3

    Default Re: Dynamic List/Menu Passing Variables

    :D Thanks so much for the info-------I will post on here again and much sooner. It work great!
    PapiYoni Guest

  5. #4

    Default Re: Dynamic List/Menu Passing Variables

    Don't forget to mark his response as the answer so we can all benefit from his
    wisdom, as you can search for answered questions only on the search page and it
    makes it so much easier to find good info that way.

    Cheers

    Chuck

    chuckomalley Guest

Posting Permissions

  • You may not post new threads
  • You may 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