<? echo ' <table border="1" width="145" height="111" class="inside"> <tr> <td height="15"> <h6>Logowanie</h6></td> </tr> <tr> <td height="76"> <p align="center"> <FORM Action="'.$_SERVER['REQUEST_URI'].'" METHOD="POST"> <input type="text" id="lg" name="log" size="20"><br> <input type="password" name="has" size="20"><br> <input type="submit" value="Loguj"></td> </form> </tr> </table> '; $file = 'user.dat'; { $loged = $_COOKIE['loged']; if ($loged == '1') { echo ' <table border="1" width="145" height="111" class="inside"> <tr> <td height="15"> <h6>Konto użytkownika</h6> </td> </tr> <tr> <td height="76"> <p align="left"> Jesteś zalogowany/wana jako '.$_COOKIE['login'].' <form action="'.$_SERVER['REQUEST_URI'].'" method="post"> <input type="hidden" name="loginout" value="1"> <input type="submit" value="Wyloguj"> </form> '; } } else { { } { if ($_POST['log'] <> '') { $log = $_POST['log']; if ($_POST['has'] <> '') { $has = $_POST['has']; $loged=0; for ($i = 0; $i <= $ile_wpisow - 1; $i++) { if ($log == $info[0]) { if ($has == $info[1]) { $loged=1; break; } else { $error = 'pass_bad'; } } else { $error = 'log_bad'; } } } else { $error = 'pass'; } } else { $error = 'log'; } }} { $error = $_GET['error']; $datas .= $info[0].'_'.$info[1].'<br>'; }} switch($error){ case 'log': break; case 'pass': break; case 'log_bad': break; case 'pass_bad': break; case 'loginw': break; } } ?>
I wyskakują takie błędy:
Warning: Cannot modify header information - headers already sent by (output started at c:\program files\easyphp1-8\www\strona\index.php:15) in c:\program files\easyphp1-8\www\strona\login.php on line 79
Warning: Cannot modify header information - headers already sent by (output started at c:\program files\easyphp1-8\www\strona\index.php:15) in c:\program files\easyphp1-8\www\strona\login.php on line 80
Warning: Cannot modify header information - headers already sent by (output started at c:\program files\easyphp1-8\www\strona\index.php:15) in c:\program files\easyphp1-8\www\strona\login.php on line 81
Są to te linie:
setcookie('loged', $loged, 0);
setcookie('login', $log, 0);
Header('Location:'.$_SERVER['REQUEST_URI']);
Co mam zrobić żeby tych błędów nie było??