title: how to rectify Undefined index: firstname in C:\wamp64\www\Form\addtodatabase.php on line 12 error
body: <p>There is a page called form.html .It directs to the page addtodatabase.php
  at the end there is submit button . </p>
  
  <pre><code>    &lt;form action="addtodatabase.php" method="post"&gt;
      &lt;form class="form-inline"&gt;
      &lt;fieldset&gt;
      &lt;legend&gt;Security Department User Registration&lt;/legend&gt;
      &lt;div class="form-group"&gt;
      &lt;label for="Firstname"&gt;First Name&lt;/label&gt;
      &lt;input type="text" class="form-control" id="Firstname" name="firstname" placeholder="Text input"&gt;&lt;br/&gt;
      &lt;/div&gt;
  
      &lt;div class="form-group"&gt;
      &lt;label for="Secondname"&gt;Second Name&lt;/label&gt;
      &lt;input type="text" class="form-control" id="Secondname" name="secondname" placeholder="Text input"&gt;&lt;br/&gt;
      &lt;/div&gt;
      &lt;/form&gt;
  </code></pre>
  
  <p>My addtodatabase.php page .</p>
  
  <pre><code>    $connect=mysqli_connect('localhost','root','','form_db');
      if(mysqli_connect_errno($connect))
      {
      echo 'Failed to connect:'.mysqli_connect_error();
      }
      $firstname=""; 
      $secondname="";
      if (isset($_POST)) { 
      $firstname  = isset($_POST['firstname']) ? $_POST['firstname'] : '';
      $secondname = isset($_POST['secondname']) ? $_POST['secondname'] : '';
      echo 'Your first name is ' .$firstname. '&lt;br&gt;'; 
      echo 'Your second name is ' .$secondname. '&lt;br&gt;'; 
      }
  </code></pre>
  
  <p>There  are three errors</p>
  
  <blockquote>
    <p>it doesn't get to the page <code>addtodatabase.php</code>.
    <a href="http://localhost:8080/form/form.html" rel="nofollow noreferrer">http://localhost:8080/form/form.html</a>?<br>
    Notice: Undefined index: firstname in C:\wamp64\www\Form\addtodatabase.php on line 12.
    nothing is being added to database. only id is increment </p>
  </blockquote>
  
  <p>Thanks in advance.</p>