I had xmlHTTPrequest GET script which was working fine, but because of server issues I had to change it to POST method. I am unable to get the value in $_POST variable. Need help to see if the javascript is correct.
xmlHTTPrequest file:
    <?php include 'accesscontrol.php'; ?>
    <?php
        include_once 'db.php';
        ?>
        <html>
        <head>
        <title>POST</title>
        <script type="text/javascript">
    function showprodes(str2)
    {
    var q2 = str2;
    if (window.XMLHttpRequest)
      {// code for IE7+, Firefox, Chrome, Opera, Safari
      xmlhttp=new XMLHttpRequest();
      }
    else
      {// code for IE6, IE5
      xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
      var url = "http://www.amg.in/amogtst/rateprod.php";
    xmlhttp.open("POST", url, true);
    xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");  
    xmlhttp.send(q2);
     }
        </script>
        </head>
        <body>
        <?
            $result2 = mysql_query("SELECT Prod_desc FROM PRODMAST ORDER BY Prod_desc");
        echo "<form name='f1'>";
        echo "<table width='730' border='0' align='center' cellpadding='0' cellspacing='1'>";
        echo "  <tr>";
        echo "  <td colspan='3'>";
            echo " <span class='style3'>Gas Type  </span> <select name='Proddesc' onchange=\"showprodes(this.value);\"><option value=0>Select a Product</option>";
            while($nt2=mysql_fetch_assoc($result2))
            {//Array or records stored in $nt
            echo "<option value='$nt2[Prod_desc]'>$nt2[Prod_desc]</option>";
            /* Option values are added by looping through the array */
            }
            echo "</select>";// Closing of list box
        echo "  </td>";
        echo "  </tr>";
        echo "</table>";
        echo "</form>";
        ?>
        </body>
        </html>
second script which updates the table as per the user selection from first php: rateprod.php file:
    <?php
    $q2=$_POST['q2'];
    include_once 'db.php';
    mysql_query("UPDATE RATEMASTER_draft SET Prod_desc='$q2'");
    ?>
 
    