skrypt index.php
<?php
function checkPass($user, $pass)
{
if(!$fd=@fopen("./passwords/passwords.txt". "r")) return false; if(($poss =strpos($line, ":"))===false) continue
; $tempUser = substr($line, 0
, $pos); if($tempUser !=$user) continue;
if($tempPass == $pass){
return true;
}
else{
return false;
}
}
return false;
}
if(isSet($_SESSION['zalogowany'])){ header("Location: glowna.php"); }
else if(isSet($_POST["haslo"]) && isSet($_POST["nazwa"]) && checkPass($_POST["nazwa"], $_POST["haslo"])){
$_SESSION["zalogowany"]= true;
header("Location: glowna.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=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<form name="formularz1"
action="index.php"
method="POST">
<div style="text-align:center">
<table align="center" border="0">
<tr>
<td colspan="2">wprowadz nazwe i haslo uzytkownika:</td>
</tr><tr>
<td>uzytkownik:</td>
<td><input type="text" name="nazwa" /></td>
</tr><tr>
<td>haslo:</td>
<td><input type="password" name="haslo" /></td>
</tr><tr>
<td colspan="2"><input type="submit" value="wejdz" /></td>
</tr>
</table>
</div>
</form>
</body>
</html>
co w tym skrypcie jest nie tak? nie chce sie logowac pomimo ze pobiera dane z passwords.txt oprocz tego sa 2 skrypty glowna.php a takze lodout.php , ktorych nie zamieszczam bo nie sa potrzebne dzieki za wszelka pomoc
Ten post edytował malgoska 19.02.2008, 22:15:40