
Mam taki o to skrypt logowania:
<?php ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl"> <head> <title>tytul</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <meta name="Description" content="asd" /> <meta name="Keywords" content="asd" /> <meta name="author" content="autor" /> <link rel="stylesheet" href="../style.css" type="text/css" media="screen" /> </head> <body> <div id="wrapper"> <div id="top"> <h1><a class="nazwa" href="#">klan</a> <span>:: admin</span></h1> <a class="kanal" href="#">chan</a> </div> <hr class="linia"></hr> <div id="bar"><span class="logowanie"><a href="#">admin</a></span><em>Ehhh:</em> 5 days</div> <hr class="linia"></hr> <div id="formlogin"> $login=$_POST['login']; $admin=$_POST['username']; include('../db.php'); $_SESSION['logged'] = $admin; } else { } } ?> <br /><h3>Logowanie</h3><br /> <form method="post" action="login.php"> <fieldset> <input type="text" name="username" class="pole" value="login" /><br /> <input type="password" name="password" class="pole" value="haslo" /><br /> <input type="submit" name="login" class="wysylaj" value="zaloguj się" /> </fieldset> </form> </div> <hr class="linia"></hr> Š Strona </div> </body> </html>
Lecz przy wejsciu na strone dostaję komunikat:
<?php Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:VertrigoServwwwlistadminlogin.php:1) in C:VertrigoServwwwlistadminlogin.php on line 25 Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:VertrigoServwwwlistadminlogin.php:1) in C:VertrigoServwwwlistadminlogin.php on line 25 ?>
Co jest nie tak?