title: php check post contains a variable
body: <p>this is my page when i run it i got the excption  which sayes that the <code>formSubmit</code> is not define . i know that i have to check if the <code>post</code> contents that variable but i couldn't know the solution </p>
  
  <pre><code> &lt;?php
      if($_POST['formSubmit'] == "Submit")
      {
          $errorMessage = "";
  
          if(empty($_POST['formPassword']))
          {
              $errorMessage .= "&lt;li&gt; You forgot to enter your password!&lt;/li&gt;";
          }
          if(empty($_POST['formName']))
          {
              $errorMessage .= "&lt;li&gt; You forgot to enter a name!&lt;/li&gt;";
          }
  
          $varPassword = $_POST['formPassword'];
          $varName = $_POST['formName'];
  
          if(empty($errorMessage)) 
          {
              require('Document1.php');
              User::add_user($varName, $varPassword);
              exit;
              //header("Location: normal.php");
          }
  
  
      }
      ?&gt;
  
      &lt;html&gt;
         &lt;head&gt;
  
          &lt;title&gt;SIGN UP&lt;/title&gt;
  
          &lt;style type="text/css"&gt;
      &lt;!--
      .style1 {
          font-size: xx-large;
          color: #0000CC;
      }
      --&gt;
          &lt;/style&gt;
      &lt;/head&gt; 
  
       &lt;body&gt;
       &lt;p align="center"&gt;&lt;br&gt;
         &lt;span class="style1"&gt;SIGN UP&lt;/span&gt;&lt;/p&gt;
       &lt;p&gt;&amp;nbsp;&lt;/p&gt;
       &lt;form action="myform1.php" method="post"&gt;
  
              &lt;p&gt;
                  What is Your NAME ?&lt;br&gt;
              &lt;input type="text" name="formName" maxlength="50" value="" /&gt;               
              &lt;/p&gt;
  
              &lt;p&gt;
                  What is Your PASSWORD ?&lt;br&gt;
                  &lt;input type="text" name="formPassword" maxlength="50" value="" /&gt;
              &lt;/p&gt;
  
              &lt;?php
              /*
              ?&gt;
              &lt;p&gt;
                  What is Your Email ?&lt;br&gt;
                  &lt;input type="text" name="formEmail" maxlength="50" value="" /&gt;
              &lt;/p&gt;
              */
                  ?&gt;          
              &lt;input type="submit" name="formSubmit" value="Submit" /&gt;
  
              &lt;input type=reset value = "delete fields "&gt;
  
       &lt;/form&gt;
       &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <h3> any help would be appreicated </h3>