title: If(isset)$_POST trouble
body: <p>I'm really battling with this and I've tried every youtube / google page I could find about this, nothing seems to fix the problem.</p>
  
  <p>When clicking submit the database collects only 'idContactForm' but not the rest (name/email/subject/message)</p>
  
  <p>I've tried everything I could find using the if(isset)$_POST line, but I always seem to get the "Undefined index: " errors on ($name / $email / $subject / $message)</p>
  
  <p>What am I doing wrong?</p>
  
  <pre><code> &lt;?php
  
      include 'config.php';
  
      if (!isset($_POST['submitted'])) {
  
          $name = trim(mysqli_escape_string($conn,$_POST['Name']));
          $email = trim(mysqli_escape_string($conn,$_POST['Email']));
          $subject = trim(mysqli_escape_string($conn,$_POST['Subject']));
          $message = trim(mysqli_escape_string($conn,$_POST['Message']));
  
      } else {
      ## connect mysql server
          $mysqli = new mysqli('localhost', 'root', '******', 'tomepublications');
          # check connection
          if ($mysqli-&gt;connect_errno) {
              echo "&lt;p&gt;MySQL error no {$mysqli-&gt;connect_errno} : {$mysqli-&gt;connect_error}&lt;/p&gt;";
              exit();
          }
  
  
              # insert data into mysql database
              $sql = "INSERT  INTO `contactform` (`idContactForm`, `Name`, `Email`, `Subject`, `Message`) 
                      VALUES (NULL, '{$name}', '{$email}', '{$subject}', '{$message}')";
  
              if ($mysqli-&gt;query($sql)) {
                  //echo "New Record has id ".$mysqli-&gt;insert_id;
                  echo "&lt;p&gt;Registred successfully!&lt;/p&gt;";
              } else {
                  echo "&lt;p&gt;MySQL error no {$mysqli-&gt;errno} : {$mysqli-&gt;error}&lt;/p&gt;";
                  exit();
              }
          }
  
      ?&gt;  
  </code></pre>
  
  <p>HTML</p>
  
  <pre><code> &lt;form method="post" action="contactf.php"&gt;
                                      &lt;div class="form-group"&gt;
                                          &lt;input type="text" name="name" id="Name" class="form-control" placeholder="Name" required&gt;
                                      &lt;/div&gt;
                                      &lt;div class="form-group"&gt;
                                          &lt;input type="email" name="email" id="Email"class="form-control" placeholder="Email" required&gt;
                                      &lt;/div&gt;
                                      &lt;div class="form-group"&gt;
                                          &lt;input type="text" name="subject" id="Subject"class="form-control" placeholder="Subject" required&gt;
                                      &lt;/div&gt;
                                      &lt;div class="form-group"&gt;
                                          &lt;textarea name="message" class="form-control" id="Message" rows="15" placeholder="Message" required&gt;&lt;/textarea&gt;
                                      &lt;/div&gt;
                                      &lt;input type="hidden" name="submitted" value="true"&gt;
                                      &lt;input type="submit" value="submit" class="btn btn-primary"&gt;Send Message&lt;/&gt;
                                  &lt;/form&gt;
  </code></pre>