Getting the value of option choosen by the user
<p>In my index file where the form and function are located, named:</p>

<p><strong>index.php</strong></p>

<pre><code>$(function() {
    $.ajax({
        type: "POST",
        url: "invtype.php",
        data: "getrevenuetype=true",
        success: function(b){
            $("#revenueType").html(b)
        }
    })
})
</code></pre>

<p><code>&lt;span name="revenueType" id="revenueType"&gt;&lt;/span&gt;&lt;br/&gt;</code></p>

<p><strong>invtype.php</strong></p>

<pre><code>&lt;?php

mysql_connect("","","") or die('Error: '.mysql_error());
mysql_select_db("dbname");

if(isset($_POST['getrevenuetype'])) {
    $sql3 = mysql_query("SELECT * FROM chartofaccount WHERE accountnumber &gt;= 4000 and accountnumber &lt;= 4999");
    $acct = '';
    $acctrow = mysql_num_rows($sql3);
    if($acctrow &gt; 0) {

    echo 'Revenue Type:&lt;select name="rename"&gt;';
        while($chartrow = mysql_fetch_array($sql3)) {
        $revenueaccountname = $chartrow['accountname'];

    $acct .= '&lt;option value="$revenueaccountname"&gt; '. $revenueaccountname .' &lt;/option&gt;';

    }

    }
}

echo $acct;
echo '&lt;/select&gt;';
</code></pre>

<p>My question is how will I get or what code should I put on to get the value of the option selected by the user? My purpose in getting the value is that I want to put it in another php where it will be used as var in inserting data into MySQL. already tried this code: <code>$name = $_POST['rename'];</code> then included 'invtype.php'; on the other php file (this is where I will use the value of option selected) but it doesn't seem to work. I know my code is all messed up and I'm really sorry about it, but guys if you can help I would really appreciate it.  </p>
