Witam wszystkich
Właśnie zabrałem sie za skrypt logowania na moją stronę z wykorzystaniem sesji, niestety kiedy się loguję - to pomimo wpisania dobrego hasła i loginu wyskakuje błąd, że haslo albo login są niepoprawne. Bardzo proszę o pomoc !
Oto pliki :
index.php
<?php session_start();?>
<?php
if(!empty($_GET['page']))
$file = 'include/'.$_GET['page'].'.php';
else $file = 'include/witam.php';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Programowanie aplikacji internetowych</title>
<link href="style/tło.css" rel="stylesheet" type="text/css" />
</head>
<body>
<table width="100%" border="1">
<tfoot><tr><td colspan="2"></td></tr></tfoot>
<tr>
<td width="15%" height="190"><img src="images/dominik.jpg" width="243" height="211" /></td>
<td width="85%">
<form id="form1" name="form1" method="post" action="index.php?page=loguj_script">
<table width="11%" border="1" align="right" cellpadding="0" cellspacing="0">
<tr>
<td><label>Logowanie:
<input name="login_check" type="text" size="25" class="textarea" />
</label></td>
</tr>
<tr>
<td><label>Haslo:
<input name="pass_check" type="password" size="25" class="textarea" />
</label></td>
</tr>
<tr>
<td><div align="center">
<input type="submit" name="submit" value="Login" />
</div></td>
</tr>
<tr>
<td><div align="center"><a href="index.php?page=rejestracja_form1">Rejestracja</a></div><div align="center">Zapomniałeś hasła -<a href="login/zapomniane_form.php"> KLIKNIJ </a></div></td>
</tr>
</table>
</form>
<div align="center">
<p><strong>POLITECHNIKA ŁÓDZKA</strong></p>
<p>Instytut informatyki </p>
</div></td>
</tr>
<tr>
<td align="top" height="663"><?php include('include/menu.php');?></td>
<td>
<?php
if(file_exists($file))
include($file);
else include('include/error.php');
?>
</td>
</tr>
</table>
</body>
</html>
loguj_script.php
<?php
session_start();
?>
<?php
$login_check = $_POST['login_check'];
$pass_check = $_POST['pass_check'];
if (!file_exists("users/$login_check.dat")):
echo("Błędne dane");
elseif (file_exists("users/$login_check.dat")):
include("users/$login_check.dat");
if(($_SESSION['login'] == $login_check) && ($_SESSION['password'] == $pass_check)): // cos tutaj chyba jest nie tak ?
echo ("witamy");
echo $_SESSION['login'];
echo("Zalogowałeś się!!");
else:
echo("niepoprawny login lub/i hasło");
endif;
endif;
?>
Bardzo proszę o rodę