未定义的变量:POST - PHP和MySQL

Tob*_*sen 1 php mysql

我有一个这样的表格:

<form name="htmlform" method="post" action="script/gen.php?postData">
            <table width="450px">
                </tr>
                <tr>
                    <td valign="top">
                        <label for="customer">Customer:</label>
                    </td>
                    <td valign="top">
                        <input  type="text" name="customer" maxlength="50" size="30">
                    </td>
                </tr>

                <tr>
                    <td valign="top"">
                        <label for="nol">Number of licences: </label>
                    </td>
                    <td valign="top">
                        <input type="text" name="nol" maxlength="50" size="30">
                    </td>
                </tr>

                <tr>
                    <td>
                        <form method="post" id="submit" action="script/gen.php">
                            <input type="button" onClick="getKey()"; value="Generate key"/>
                    </td>
                </tr>



                <div id="innhold">
                            <h4>Licence Key: </h>
                </div>

                <tr>
                    <td colspan="2" style="text-align:center">
                        <input type="submit" value="Submit"> 
                    </td>
                </tr>

                </table>
            </form>
Run Code Online (Sandbox Code Playgroud)

感兴趣的代码行是:

<input type="text" name="nol" maxlength="50" size="30">
Run Code Online (Sandbox Code Playgroud)

<input  type="text" name="customer" maxlength="50" size="30">
Run Code Online (Sandbox Code Playgroud)

我尝试将此信息写入这样的数据库:

function postData($key1) {
//just to check if the key is equal to the one thats posted to the user
//echo '<h5>From postData' . $key1 . '</h5>';
/*echo '<script type="text/javascript"> alert("The order has been submitted successfully");
location = "/Webpanel/index.html";
</script>';*/

$customerVar = $POST['customer'];
$nolVar = $POST['nol'];

mysql_connect("localhost","root","") or die(mysql_error());
mysql_select_db("licencedatabase");

$query_add = "INSERT INTO licence (`customer_name`,`licence_count`) VALUES ('$customerVar','$nolVar')";
$query_exec = mysql_query($query_add) or die(mysql_error()); 
mysql_close();
}
Run Code Online (Sandbox Code Playgroud)

但我一直收到错误:

Undefined variable: POST
Run Code Online (Sandbox Code Playgroud)

我怎么能做到这一点?提前致谢.

abh*_*kdz 7

它的$ _POST没有$POST.

$customerVar = $_POST['customer'];
$nolVar = $_POST['nol'];
Run Code Online (Sandbox Code Playgroud)