Getting dynamic dropdown value to a Session in PHP
<p>a PHP newbie here and need to clarify a thing.</p>

<p>I have populated a dropdown box with data from a SQL database. The code looks like like below.</p>

<pre><code>echo '&lt;select id="dropMe" name="dropMe" style="width:150px; font-family:Georgia;"&gt;';
echo '&lt;option value=""&gt;&lt;/option&gt;';
while($rec=mysql_fetch_array($run1))
{
    $value = $rec['route'];
    echo "&lt;option value=\"$value\"&gt;$value&lt;/option&gt;";
}
echo '&lt;/select&gt;';
</code></pre>

<p>What I want to know it is it possible to assign a value selected by a user to a SESSION hence this is a dynamic dropdown? (saveroute is my submit button)</p>

<pre><code>if (isset($_POST['saveroute']))
{
    $Q = $_POST['dropMe'];
    $_SESSION['menuRoute'] = $Q;
    echo ($_SESSION['menuRoute']);
}
</code></pre>

<p>I code something like this, but I get an undefined error with 'dropMe'. I'm not quiet familier with this type of error and can some one throw some suggestions or point out any errors in the method.</p>

<p>Thanks for looking.  </p>
