title: PHP: Having a problem with get_post
body: <p>I am having a problem with the get_post method.  Here is my code: </p>
  
  <pre><code>&lt;!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"&gt;
  &lt;html&gt;
  &lt;head&gt;
  &lt;title&gt;Upload2&lt;/title&gt;
  &lt;link href="style.css" rel="stylesheet" type="text/css"&gt;
  &lt;/head&gt;
  
  &lt;body&gt;  
  
  &lt;h1&gt; Welcome to my search Engine &lt;/h1&gt;
  
  &lt;?php
  
  # SETUP
  $thisFile = 'v4.php';
  
  # INPUT FIELDS
  echo &lt;&lt;&lt; END
  &lt;form action="$thisFile" method="post"&gt;
  &lt;pre&gt;
  Search &lt;input type="text" name="searchTerm"/&gt;
         &lt;input type="submit" value="Add Record"/&gt;
  &lt;/pre&gt;
  &lt;/form&gt;
  END;
  
  # EXTRACT INPUTTED FIELDSA
  if(isset($_POST['searchTerm'])) {
  
          # INITIALIZE INPUTTED VARIABLES
          $mySearchTerm = get_post('searchTerm'); # &lt;- PROBLEM LINE!
          echo "You searched for: $mySearchTerm";
  }
  
  ?&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>The code works well before a search term is entered.  The html looks as expected and this page is displayed in a browser:</p>
  
  <p><img src="https://i.stack.imgur.com/sA4vb.png" alt="alt text"></p>
  
  <p>After I enter a search term the pages looks the same BUT after going View -> Page Source I noticed something interesting.  The end of the page looks like this:</p>
  
  <pre><code>Search &lt;input type="text" name="searchTerm"/&gt;
         &lt;input type="submit" value="Add Record"/&gt;
  &lt;/pre&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p><strong>NOTE:</strong> There is no ending <code>&lt;/body&gt;&lt;/html&gt;</code> </p>