Unexpected { expected (?
<p>Parse error: syntax error, unexpected '{', expecting '(' in /home/a7237281/public_html/include/session.php  on line 313</p>

<p>this is the error i get, relating to this code</p>

<pre><code>      //check the emails
  $field = "email";  //Use field name for email
  $field2 = "email2";
  if(!$subemail || strlen($subemail = trim($subemail)) == 0)
  {
     $form-&gt;setError($field, "* Email not entered");
  }
  else if
  {
     /* Check if valid email address */
     $regex = "^[_+a-z0-9-]+(\.[_+a-z0-9-]+)*"
             ."@[a-z0-9-]+(\.[a-z0-9-]{1,})*"
             ."\.([a-z]{2,}){1}$";
     if(!eregi($regex,$subemail))
     {
        $form-&gt;setError($field, "* Email invalid");
     }
     else if ($subemail !== $subemail2)
     {
        $form-&gt;setError($field2, "* Emails does not match");
     }
     $subemail = stripslashes($subemail);
  }
  /* Check if email is already in use */
  else($database-&gt;emailTaken($subemail))
  {
    $form-&gt;setError($field, "* Email address already in use");
  }
</code></pre>

<p>And its referring to the { after the first else if.</p>

<p>I have edited with the entire piece of code, what could i do now?</p>
