Witam! Kolega dał mi dziś skrypt logowania do sprawdzenia, leczcoś jest tam nie tak ale nie wiem co bo wyświetla komuniakt: Do poprawnego działania skryptu wymagana jest przegl±darka Mozilla Firefox! mimo że ją mam ;/;/
O to 3 pliki odpowiedzialne za logowanie...
gora.php - plik odpowiedzialny za wygląd, lecz tutaj wywala ten błąd ;/
<?php
if(!isSet($_SESSION['zalogowany'])){ $_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
$userNameLength = strlen($user); $userPassLength = strlen($haslo);
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
if(isSet($_SESSION['zalogowany'])){ }
else if(!isSet($_POST['haslo']) || !isSet($_POST['user'])){ $_SESSION['komunikat'] = "Wpisz nazwę i hasło użytkownika";
include('index.php');
}
else{
$user = $_POST["user"];
$haslo = md5($_POST["haslo"]);
$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
if(isSet($_SESSION['komunikat'])){ echo $_SESSION['komunikat']; }
else{
echo "WprowadĽ nazwę i hasło użytkownika"; }
?>
<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 {
header("Location: install.php"); }
?>
prosze o pomoc.