title: Dividing HTML Code Into PHP Sections---Having Errors With My PHP
body: <p>I'm working on a web page for a class.  It is a site designed for upcoming freshmen to receive information on the major(s) they are interested in.</p>
  
  <p>For the assignment, I have to divide my original HTML code into a header.php, content.php, and footer.php.  I also have to use the POST method for my form with an action of $ SERVER[PHP SELF].  I also have to use a hidden input field in the form.  </p>
  
  <p>I have done all these tasks, but I think something is wrong with my heredoc print &lt;&lt;
  
  <p>I know I have some more work to do with my form, but I would really just love to see that the page will load correctly with my header, content, and footer.  Since I can't see anything, I don't want to go ahead and write out any other functions.  Would you please look at my PHP code and help me find this bug?  I'm sure I'm just overlooking something, but I'd appreciate the help!  Thanks!</p>
  
  <p>Header.php:</p>
  
  <pre><code>&lt;!doctype html&gt;
  &lt;html lang="en"&gt;
  
  &lt;head&gt;
  &lt;meta charset="UTF-8"&gt;
  &lt;title&gt;UNA Preview Day 2013&lt;/title&gt;
  &lt;link rel="stylesheet" href="preview.css"&gt;
  &lt;script src="preview.js"&gt;&lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
  </code></pre>
  
  <p>Content.php:  </p>
  
  <pre><code>&lt;!-- Tell script impaired users we *must* have Javascript --&gt;
  &lt;noscript&gt;
      &lt;p class="alert"&gt;Sorry, this page requires Javascript!&lt;/p&gt;
  &lt;/noscript&gt;
  
  &lt;img src= "banner.gif" alt = "UNA Logo" /&gt;
  &lt;br /&gt;
  &lt;h1&gt;UNA Preview Day 2013&lt;/h1&gt;
  </code></pre>
  
  <p>Footer.php</p>
  
  <pre><code>    &lt;div class = "image"&gt;
      &lt;img src = "unapic.png" alt = "UNA Logo" /&gt;
  &lt;/div&gt;
  &lt;p id = "footer"&gt;Copyright &amp;copy; 2013 | University of North Alabama&lt;/p&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>Index.php:</p>
  
  <pre><code>&lt;?PHP
  require("header.php");
  
  if ($_POST[_submit_check])  { 
  processForm();
  }
  else  {
  displayForm();
  }
  
  function displayForm()  {
  require("content.php");
  }
  
  require("footer.php");
  
  if (array_key_exists('_submit_check', $_POST))  {
  processForm();
  }
  else  {
  displayForm();
  } 
  
  // ------------------------------------------------
  function processForm()  {    //NEEDS WORK
  print "Hello, $_POST[user]!";
  }
  
  function display_form()  {
  //require("content.php");  
  
  print &lt;&lt;&lt;HTMLBLOCK
   &lt;html&gt;
      &lt;head&gt; 
      &lt;title&gt;UNA Preview Day 2013&lt;/title&gt;
      &lt;/head&gt;
      &lt;body&gt;
      &lt;form name = "contact" method = "POST" action="$_SERVER[PHP_SELF]"&gt;                
      &lt;div class = "appearance"&gt;
      *All fields required.*&lt;br /&gt;&lt;br /&gt;
      Name: *  &lt;input title="Name required!" type = "text" id = "name" name = "name"        required autofocus onchange = "validName();" size = 30&gt;
      &lt;br /&gt;
      Email: * &lt;input title="Email address of form username@domain required!" type =   "email" placeholder = "me@example.com" id = "email" name = "email" 
      required onchange = "validAddress();" size = 30&gt;
      &lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
      Areas of Study &lt;br /&gt;
      Check the program(s) in which you are interested in. (*Check AT LEAST one.*) &lt;br /&gt;
      &lt;input type = "checkbox" id = "cs" name = "option[]"&gt;Computer Science&lt;br /&gt;
      &lt;input type = "checkbox" id = "cis" name = "option[]"&gt;Computer Information Systems&lt;br     /&gt;
      &lt;input type = "checkbox" id = "ddep" name = "option[]"&gt;Dual Degree Engineering    Program&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;
      &lt;div class = "center"&gt;
          &lt;input type="button" value="Send" onClick = "return validOption()"&gt;
          &lt;input type="reset" value="Clear"&gt;
      &lt;/div&gt;
      &lt;input type = "hidden" name="_submit_check" value="1"&gt;  
      &lt;/div&gt;
      &lt;br /&gt;
      &lt;br /&gt;
      &lt;/form&gt;
      &lt;/body&gt;
  &lt;/html&gt; 
  HTMLBLOCK;  
  }
  ?&gt;
  </code></pre>