PHP: Parse error, unexpected $end
<p>Basically, Its a login form. I want it to only show the login form, when a user session exists (that is when he is logged in). But I am getting the following error</p>

<pre><code>Parse error: syntax error, unexpected $end in C:\xampp\htdocs\zabis\index.php on line 113
</code></pre>

<p>Code is given below:</p>

<pre><code>&lt;?php
error_reporting(E_ALL ^ E_NOTICE);
define('INCLUDE_CHECK',true);

require 'connect.php';
require 'functions.php';

session_name('tzLogin');
// Starting the session

session_set_cookie_params(2*7*24*60*60);
// Making the cookie live for 2 weeks

session_start();

if($_SESSION['id'] &amp;&amp; !isset($_COOKIE['tzRemember']) &amp;&amp; !$_SESSION['rememberMe'])
{
    // If you are logged in, but you don't have the tzRemember cookie (browser restart)
    // and you have not checked the rememberMe checkbox:

    $_SESSION = array();
    session_destroy();

    // Destroy the session
}


if(isset($_GET['logoff']))
{
    $_SESSION = array();
    session_destroy();

    header("Location: demo.php");
    exit;
}

if ($_POST['submit']=='login')
{
  $err = array();

  if(!$_POST['username'] || !$_POST['password'])
                         $err = 'username or password missing!';

  if(!count($err))
  {

    $username = mysql_real_escape_string($_POST['username']);
    $password = mysql_real_escape_string($_POST['password']);
    $rememberMe = (int)$_POST['rememberMe'];


    $row = mysql_fetch_assoc(mysql_query("SELECT id,usr FROM members WHERE usr='{$username}' AND pass='".md5($password)."'"));

    if($row['usr'])
    {
      $_SESSION['usr']=$row['usr'];
      $_SESSION['id']=$row['id'];
      $_SESSION['rememberMe']=$_POST['rememberMe'];

      //setcookie('tzRemember',$_POST['rememberMe']);

      if($rememberMe=="on")
       setcookie('zsRememberMe',$username, time()+7200);


    }
    else
        $err[] = "wrong username or password!";
  }

  if($err)
   $_SESSION['msg']['login-err'] = implode('&lt;br/&gt;',$err);

   header("Location: index.php");
   exit;
}
else
    die("Please enter a username and password.");


?&gt;





&lt;html&gt;
&lt;body&gt;

&lt;?php
            if(!$_SESSION['id']):
            ?&gt;
&lt;div id="content"&gt;
  &lt;h1&gt;Login Form&lt;/h1&gt;
  &lt;form id="form1" name="form1" action="doLogin.php" method="post"&gt;
    &lt;p&gt;
      &lt;label for="username"&gt;Username: &lt;/label&gt;
      &lt;input type="text" name="username" id="username" /&gt;
    &lt;/p&gt;
    &lt;p&gt;
      &lt;label for="password"&gt;Password: &lt;/label&gt;
      &lt;input type="password" name="password" id="password" /&gt;
    &lt;/p&gt;
    &lt;p/&gt;
    &lt;input type="checkbox" name="rememberMe"&gt; Remember me
    &lt;p&gt;
      &lt;input type="submit" id="login" name="login" /&gt;
    &lt;/p&gt;
  &lt;/form&gt;
    &lt;div id="message"&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;/body&gt;
&lt;/html&gt;
</code></pre>
