Parse error: syntax error, unexpected T_VARIABLE
The Error is on line 14 for some reason it isn't working very well with the second Query. it is pretty strange. i have never had this problem before.

    <?
     	$email = $_POST['email'];
    	$password = sha1($_POST['password']);
    	$connection = mysql_connect("localhost","root","password");
    	$sql = "SELECT * FROM `db`.`users` WHERE '$username' == `email`;";
    	$query = mysql_query($sql,$connection);
    	$return = mysql_fetch_assoc($query);
    	if ($return["email"] == $email || $return["pass_h"] == $password){
    		$badlogin = false;
    		$time = time();
    		$cook = sha1($return["pass_h"].$time);
    		setcookie("gamerlogin",$cook,3600 * 24 * 7 + $time);
    		$sql1 = "INSERT INTO `db`.`cookie_id` (`id`, `hash`, `email`, `time`) VALUES (NULL, '$cook', '$email', '$time');"
    		$query1 = mysql_query($sql1);
    		if (!$query1){
    			die("Could Not Query Error: Cookie");
    		}
    	}else{$badlogin = true}
    ?>
    <?
    	if ($badlogin == true){
    		header("http://localhost/demo/");
    	}
    	
    	if ($badlogin == false){
    		header("http://localhost/demo/login/?code=badlogin");
    	}
    ?>
Parse error: syntax error, unexpected T_VARIABLE
===

The Error is on line 14 for some reason it isn't working very well with the second Query. it is pretty strange. i have never had this problem before.

    <?
     	$email = $_POST['email'];
    	$password = sha1($_POST['password']);
    	$connection = mysql_connect("localhost","root","password");
    	$sql = "SELECT * FROM `db`.`users` WHERE '$username' == `email`;";
    	$query = mysql_query($sql,$connection);
    	$return = mysql_fetch_assoc($query);
    	if ($return["email"] == $email || $return["pass_h"] == $password){
    		$badlogin = false;
    		$time = time();
    		$cook = sha1($return["pass_h"].$time);
    		setcookie("gamerlogin",$cook,3600 * 24 * 7 + $time);
    		$sql1 = "INSERT INTO `db`.`cookie_id` (`id`, `hash`, `email`, `time`) VALUES (NULL, '$cook', '$email', '$time');"
    		$query1 = mysql_query($sql1);
    		if (!$query1){
    			die("Could Not Query Error: Cookie");
    		}
    	}else{$badlogin = true}
    ?>
    <?
    	if ($badlogin == true){
    		header("http://localhost/demo/");
    	}
    	
    	if ($badlogin == false){
    		header("http://localhost/demo/login/?code=badlogin");
    	}
    ?>