title: nothing happens after clicking submit button
body: <p>I can not figure out what i missed here in my code. i if else statement is working because i can see my form and after submitting i suppose to see message after  tag. How would i know if submit button is respond or not. </p>
  
  <pre><code> &lt;?php
  
  $output_form = true;
  
  $fname = "";
  $lname = "";
  $address1 ="";
  $address2 ="";
  $city = "";
  $state = "";
  $zipcode = "";
  
  if (isset($_POST['submit'])) { 
  
  print_r($_POST);
  
      $fname = trim($_POST["firstName"]);
      $lname = trim($_POST['lastName']);
      $address1 = trim($_POST['address1']);
      $address2 = trim($_POST['address2']);
      $city = trim($_POST['city']);
      $state = trim($_POST['state']);
      $zipcode = trim($_POST['zipcode']);
  
  }
  
  ?&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;title&gt;Assignment 3 &lt;/title&gt;
          &lt;link rel="stylesheet" type="text/css" href="style.css"&gt;
  
      &lt;/head&gt;
      &lt;body&gt;
  
          &lt;?php 
          if ($output_form) {
          ?&gt;
  
          &lt;h1&gt;Enter your information&lt;/h1&gt;
  
          &lt;form name="userform" action="&lt;?= $_SERVER['PHP_SELF'] ?&gt;" method="post"&gt;
  
              &lt;p&gt;First Name: &lt;input name="firstName" type="text" value="&lt;?= $fname ?&gt;"&gt;&lt;/p&gt;
              &lt;p&gt;Last Name: &lt;input name="lastName" type="text" value="&lt;?= $lname ?&gt;"&gt;&lt;/p&gt;
              &lt;p&gt;Address 1: &lt;input name="address1" type="text" value="&lt;?= $address1 ?&gt;"&gt;&lt;/p&gt;
              &lt;p&gt;Address 2: &lt;input name="address2" value="&lt;?= $address2 ?&gt;" type="text" &gt;&lt;/p&gt;
              &lt;p&gt;City: &lt;input name="city" type="text" value="&lt;?= $city ?&gt;"&gt;&lt;/p&gt;
              &lt;p&gt;State: &lt;input name="state" type="text" value="&lt;?= $state ?&gt;"&gt;&lt;/p&gt;
              &lt;p&gt;Zip Code: &lt;input name="zipcode" type="number" value="&lt;?= $zipcode ?&gt;"&gt;&lt;/p&gt;
              &lt;input class="button" name="submit" type="button" value="Button"&gt;
          &lt;/form&gt;
          &lt;?php
              } else {
  
          ?&gt;
                  &lt;h2&gt;Your information is:&lt;/h2&gt;
                  &lt;p class="result"&gt;
                  Name: &lt;?= $fname.' '.$lname ?&gt;&lt;br&gt;
                  Street Address: &lt;?= $address1 ?&gt;&lt;br&gt;
                  City, State: &lt;?=$city.' '.$state ?&gt;
                  &lt;/p&gt;
  
          &lt;?php
          }
          ?&gt;
  
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>