Session variable not storing the selected drop down value
<p>I am trying to store a selected drop down value in session variable and every time i print that variable which i am using on other page it shows me the last value of array from which i am populating my drop down basically.
here is the code;</p>

<pre><code>&lt;?php $options = array('2CHECKOUT','PAYPAL'); ?&gt;

&lt;select name="payment" style="width:225px;" id ="mySelect"&gt;
    &lt;?php foreach($options as $opt) { ?&gt;
        &lt;?php $selected = (isset($_SESSION['payment']) &amp;&amp; $opt == $_SESSION['payment']) ? ' SELECTED' : '';
        echo '&lt;option value="'.$opt.'"' .$selected.'&gt;'.$opt.'&lt;/option&gt;'; ?&gt;
    &lt;?php } ?&gt;
    &lt;?php error_log("the session var".print_r($_SESSION['payment'])); ?&gt;
&lt;/select&gt; &lt;/div&gt; 
</code></pre>

<p>Can somebody help me?</p>
