title: Parse error: syntax error, unexpected T_EXIT and unable to use login session across pages in php
body: <p>Getting error: Parse error: syntax error, unexpected T_EXIT in C:\wamp\www\login.php on line 47. Need some help. It was working yesterday</p>
  
  <pre><code>&lt;?php
  
  require_once("config.php");
  
  $email=$_POST['email'];
  $password=$_POST['password'];
  
  $email = stripslashes($email);
  $password = stripslashes($password);
  $email = mysql_real_escape_string(strip_tags($email));
  $password = mysql_real_escape_string(strip_tags($password));
  
  // Check occurence of email password combination
  $sql="SELECT * FROM register WHERE email='$email'";
  $result=mysql_query($sql); 
  
  
  // Mysql_num_row is counting table row
  $count=mysql_num_rows($result);
  
  // If result matched $email, table row must be 1 row
  if($count==1)
  {
  $row = mysql_fetch_array($result);
  if($password == $row['password'])
  {
  session_start();
  $_SESSION['login'] = "1";
  header("location:home.html");
  exit;
  }
  else 
  {
  echo "Please enter correct Password";
  header("location:login.html");
  session_start();
  $_SESSION['login'] = '' 
  exit();
  }
   }  
  else
  {
  header("Location:register.html");
  exit();
  }
  
  ?&gt;
  </code></pre>
  
  <p>Also added following Snippet to home.php but cant use login session</p>
  
  <pre><code>&lt;?php
  
  session_start();
  require_once("config.php");
  
  if (!(isset($_SESSION['login']) &amp;&amp; $_SESSION['login'] != '')) {
  
  header ("Location: login.html");
  
  exit;
  
  }
  ?&gt;
  </code></pre>