title: PHP echo values outside conditional if
body: <p>I have the following PHP code:</p>
  
  <pre><code>    &lt;?php
      //Connection to PDO Database
      ?&gt;
  
      &lt;form method="post" action=""&gt;
      &lt;p&gt;Busisness telephone 1&lt;/p&gt;&lt;input id="business_telephone_01" name="business_telephone_01" tabindex="auto" value="&lt;?php echo $result['business_telephone_01']; ?&gt;" type="text" /&gt;
      &lt;input name="submit" type="submit" value="Save Changes"&gt;&lt;/form&gt;
  
      &lt;?php
      //Get from Form
  
      if((empty($_POST['submit']) === false)){
      $business_telephone_01 = $_POST['business_telephone_01'];
  //Formating of telephone numbers
  $message = 'This message I want to display';
  echo 'This is another message';
        }
  
  echo $message;
      //Code to update table through PDO
  ?&gt;
  </code></pre>
  
  <p>Regardless of where I do the echo whether it is <em>echo 'This is another message';</em> within the conditional brackets or _ echo $message;_ outside the brackets nothing is being echoed and no error is being displayed.</p>
  
  <p>The html form and the PDO are working correctly and are being updated but nothing is being echoed. No error is being shown in the error log.</p>
  
  <p><strong>UPDATE:</strong></p>
  
  <ul>
  <li>If I use <code>if((empty($_POST['submit']) === false)){</code> I get  PHP
  Notice:  Undefined variable: hello </li>
  <li>If I use <code>if    (isset($_POST['submit'])) {</code> I get  PHP Notice: 
  Undefined variable:    hello  </li>
  <li>If I use <code>if (!isset($_POST['submit']))
  {</code> it gives me a list    of undefined variables that I use e.g. from
  my code above business_telephone_01</li>
  </ul>
  
  <p><strong>My full code</strong></p>
  
  <pre><code>if((empty($_POST['submit']) === false)){
  //Get from Form
          $address_building_name = $_POST['address_building_name'];
          $address_building_number = $_POST['address_building_number'];
          $address_street = $_POST['address_street'];
          $address_locality = $_POST['address_locality'];
          $address_postcode = $_POST['address_postcode'];
          $address_country = $_POST['address_country'];
  
  //Formating of address
          $address_building_number = strtoupper($address_building_number);
          $address_building_number = str_replace(' ','',$address_building_number);
          $address_building_name = ucwords($address_building_name);
          $address_street = ucwords($address_street);
          $address_locality = ucwords($address_locality);
          $address_postcode = strtoupper($address_postcode);
          $address_country = ucwords($address_country);
  
          echo 'Hello';
          $good = 'Good bye';
  
      } 
      echo $good;
  </code></pre>