Witam. Mam logowanie i mi nie działa

. Wyskakuje na stronie błąd:
Warning: session_start() [
function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\usr\www\townoflaugh\index.php:20) in
C:\usr\www\strona\log.php on line
2 Warning: session_start() [
function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\usr\www\townoflaugh\index.php:20) in
C:\usr\www\strona\log.php on line
2
Kod Strony:
<?php
function checkPass($user, $pass)
{
if(!$fd = @fopen("/secure/passwords.txt", "r")) return false; $result = false;
if(count($arr) < 2
) continue
;
if($arr[0] != $user) continue;
if($arr[1] == $pass){
$result = true;
break;
}
}
return $result;
}
if(isSet($_SESSION['zalogowany'])){ header("Location: glowna.php"); }
else if(isSet($_POST['user']) && isSet($_POST['haslo'])){ if(checkPass($_POST['user'], $_POST['haslo'])){
$_SESSION['zalogowany'] = true;
header("Location: glowna.php"); }
}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<meta http-equiv="Content-type" content="text/html; charset=iso-8859-2"> <title>Town Of Laugh :: Najśmieszniejszy Portal Rozrywkowy :: Logowanie
</title> <form name = "formularz1" action = "glowna.php"
method = "POST"
>
<td colspan="2" align="center"> Podaj nazwę i hasło
<input type="text" name="user"> <input type="password" name="haslo"> <td colspan="2" align="center"> <input type="submit" value="Wejdź">
Czy może mi ktoś z łaski swojej pomóc??