<? include "config.php"; $error=''; } } } if ( ($user == $r['user']) && ($pass == $r['pass']) ) { $_SESSION['valid'] = 1; $_SESSION['user'] = $r['user']; } else { $error = 'Niepoprawne dane użytkownika lub hasło.'; } } ?> <html> <head> <title>Logowanie</title> <style> form { border: 1px solid black; padding: 10px } #error { color: #FF0000; font-weight: bold; } </style> </head> <body> <? ?> <form action="<?= $_SERVER['PHP_SELF'] ?>" method="post"> <p>Witamy na stronie</p>
<p>Login: <input type="test" name="user" value="<?= @$user ?>"> <br /> Haslo: <input type="password" name="pass" value="<?= @$pass ?>"> </p> <p><input type="submit" value="Zaloguj" /></p> </form> </body> </html>
1. strona po zalogowaniu nie przełącza się na index.php
2. taki error: Warning: Cannot modify header information - headers already sent by (output started at E:\Programowanie\php\strona\login.php:12) in E:\Programowanie\php\strona\login.php on line 25
Nie wiem co z tym zrobić. Pomocy!