title: PHP Parse error: syntax error, unexpected end of file on line 59
body: <p>i get the following error:</p>
  
  <p>PHP Parse error:  syntax error, unexpected end of file on line 59</p>
  
  <p>Here is my code:</p>
  
  <pre><code>&lt;?php
  require_once("FormFunctions.php");
  require_once("ValidationFunction.php");
  
  $errors = array();
  $message = "";
  
  if (isset($_POST['submit'])){ // form was submitted
          $username = trim($_POST["username"]);
          $password = trim($_POST["password"]);
  
          // validations
          $fields_required = array("username", "password");
          foreach($fields_required as $field){
              $value = trim($_POST[$field]);
              if (!has_presence($value)){
              $errors[$field] =  ucfirst($field) . " cannot be blank";
              }
          }
          $field_max_length = array("username" =&gt; 10, "password" =&gt; 5);
          foreach($fields_max_length as $field =&gt; $max){
              $value = trim($_POST[$field]);
              if (!max_length($value, $max)){
              $errors[$field] =  ucfirst($field) . " is too long";
  
          if (empty($errors)){
              // try to log in
              if ($username == "CIS108" &amp;&amp; $password == "PHP"){ // login successful
                  redirect_to("process1.php");
              } else{ // login failed
                  $message = "Login failed! Username and password combination was incorrect.&lt;br/&gt;Please log in again.";
              }
          }
  
  } else{
  $message = "please log in.";
  }
  
  
  ?&gt;
  &lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"               "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;
  &lt;html xmlns="http://www.w3.org/1999/xhtml"&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt;
  &lt;title&gt;Form Two&lt;/title&gt;
  &lt;/head&gt;
  
  &lt;body&gt;
  &lt;h1&gt;Third form login&lt;/h1&gt;
  &lt;b&gt;&lt;?php echo $message;?&gt;&lt;/b&gt;
  &lt;b&gt;&lt;?php echo form_errors($errors);?&gt;&lt;/b&gt;
  &lt;form action="Form3.php" method="post"&gt;
      First Name: &lt;input type="text" name="first_name" value="" /&gt;&lt;br /&gt;
      Last Name: &lt;input type="text" name="last_name" value="" /&gt;&lt;br /&gt;
      Username: &lt;input type="text" name="username" value="" /&gt;&lt;br /&gt;
      Password: &lt;input type="password" name="password" value="" /&gt;&lt;br /&gt;&lt;br /&gt;
      &lt;input type="submit" name="submit" value="Submit Form" /&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I don't understand why I am getting this error. I have sifted through this code over and over but can't seem to see what is wrong. I am pretty new at writing code, so it would surprise me if its something simple, but i just don't see it.</p>