title: Undefined variable: POST - PHP and MySQL
body: <p>I've got a form like this:</p>
  
  <pre><code>&lt;form name="htmlform" method="post" action="script/gen.php?postData"&gt;
              &lt;table width="450px"&gt;
                  &lt;/tr&gt;
                  &lt;tr&gt;
                      &lt;td valign="top"&gt;
                          &lt;label for="customer"&gt;Customer:&lt;/label&gt;
                      &lt;/td&gt;
                      &lt;td valign="top"&gt;
                          &lt;input  type="text" name="customer" maxlength="50" size="30"&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
  
                  &lt;tr&gt;
                      &lt;td valign="top""&gt;
                          &lt;label for="nol"&gt;Number of licences: &lt;/label&gt;
                      &lt;/td&gt;
                      &lt;td valign="top"&gt;
                          &lt;input type="text" name="nol" maxlength="50" size="30"&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
  
                  &lt;tr&gt;
                      &lt;td&gt;
                          &lt;form method="post" id="submit" action="script/gen.php"&gt;
                              &lt;input type="button" onClick="getKey()"; value="Generate key"/&gt;
                      &lt;/td&gt;
                  &lt;/tr&gt;
  
  
  
                  &lt;div id="innhold"&gt;
                              &lt;h4&gt;Licence Key: &lt;/h&gt;
                  &lt;/div&gt;
  
                  &lt;tr&gt;
                      &lt;td colspan="2" style="text-align:center"&gt;
                          &lt;input type="submit" value="Submit"&gt; 
                      &lt;/td&gt;
                  &lt;/tr&gt;
  
                  &lt;/table&gt;
              &lt;/form&gt;
  </code></pre>
  
  <p>The codelines of interest is:</p>
  
  <pre><code>&lt;input type="text" name="nol" maxlength="50" size="30"&gt;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>&lt;input  type="text" name="customer" maxlength="50" size="30"&gt;
  </code></pre>
  
  <p>I try to write this information to a database like this:</p>
  
  <pre><code>function postData($key1) {
  //just to check if the key is equal to the one thats posted to the user
  //echo '&lt;h5&gt;From postData' . $key1 . '&lt;/h5&gt;';
  /*echo '&lt;script type="text/javascript"&gt; alert("The order has been submitted successfully");
  location = "/Webpanel/index.html";
  &lt;/script&gt;';*/
  
  $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();
  }
  </code></pre>
  
  <p>But I keep getting the error:</p>
  
  <pre><code>Undefined variable: POST
  </code></pre>
  
  <p>How can I accomplish this? Thanks in advance. </p>