O to 3 pliki odpowiedzialne za logowanie...
gora.php - plik odpowiedzialny za wygląd, lecz tutaj wywala ten błąd ;/
<?php $_SESSION['komunikat'] = "Do poprawnego działania skryptu wymagana jest przeglądarka Mozilla Firefox!"; include('index.php'); } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=iso-8859-2"> <title>Race</title> <link rel="stylesheet" href="style_main.css" type="text/css"> </head> <body> <?php include('baza.php'); include('header.php'); ?> <table cellspacing="0" cellpadding="0" border="0" width="980"> <tr> <td class="pad" bgcolor="#ffffff" rowspan="3" valign="top" width="196"><?php include('lmenu.php'); ?></td> <td class="g"> </td> <td class="pad" bgcolor="#ffffff" rowspan="3" valign="top" width="582">
login.php
<?php function checkPass($user, $haslo){ // sprawdzenie długości loginu i hasła if($userNameLength < 3 || $userPassLength < 3){ return 2; } // połączenie z bazą danych include('baza.php'); // zapytanie potwierdzające poprawność użytkownika $query = "SELECT COUNT(*) FROM users WHERE user='$user' "; $query .= "AND haslo='$haslo' "; return 1; } // sprawdzenie użytkownika return 1; } else{ if($row[0] <> 1){ return 2; } else{ return 0; } } } // rozpoczęcie sesji odpowiedzialnej za logowanie } $_SESSION['komunikat'] = "Wpisz nazwę i hasło użytkownika"; include('index.php'); } else{ $user = $_POST["user"]; $val = checkPass($user, $haslo); if($val == 0){ $_SESSION['zalogowany'] = $_POST['user']; } else if($val == 1){ $_SESSION['komunikat'] = "Błąd serwera. Zalogowanie się nie było możliwe. Spróbój ponownie póĽniej"; include('index.php'); } else if($val == 2){ $_SESSION['komunikat'] = "Zły login lub hasło"; include('index.php'); } else{ $_SESSION['komunikat'] = "Gra chwilowo nieczynna z przyczyn technicznych. Spróbuj ponownie póĽniej"; include('index.php'); } } ?>
index.php
<?php ?> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-type" content="text/html; charset=iso-8859-2"> <meta name="Description" content=" [wstaw tu opis strony] "> <meta name="Keywords" content=" [wstaw tu slowa kluczowe] "> <title>Race</title> <link rel="stylesheet" href="style.css" type="text/css"> </head> <body> <div class="glowny"> <?php } else{ } ?> <form action="login.php" method="POST"> <table> <tr> <td><b>Login: </b></td><td><input type="text" name="user" maxlength="16"></td><td> </td> </tr> <tr> <td><b>Hasło: </b></td><td><input type="password" name="haslo" maxlength="16"></td><td><input type="submit" name="loguj" value="Zaloguj"></td> </tr> <tr> <td colspan="3"><a href="rejestracja.php">Rejestracja</a> | <a href="przypomnij.php">Przypomnij hasło</a></td> </tr> </table> </form> </div> </body> </html> <?php } else { } ?>
prosze o pomoc.