Witam, męczę się już nad taką błahostką z 30min.. albo coś mój serwer już świruje albo ja, napisałem najprostsze na świecie logowanie i nie przekazuje danych do sesji..
Plik index.php :
<?php
$admin=$_SESSION['discofmnick'];
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<head>
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-type" content="text/html;charset=windows-1250" />
<meta name="Authoring_tool" content="x" />
<meta http-equiv="Reply-to" content="x" />
<meta name="Description" content="x" />
<meta http-equiv="content-language" content="pl" />
<meta name="author" content="x" />
<title>x</title>
<link rel="stylesheet" href="../style.css" type="text/css" />
</head>
<html>
<body>
<?php
switch($_GET['page'])
{
case 'login':
include('include/login.php');
break;
case 'logout':
include('include/logout.php');
break;
}
if (!$admin) {
?>
<div id="loginform"><div>
<div style="text-align: center;">Panel administracyjny</div>
<form action="index.php?page=login" method="post">
<p><label>Login:</label> <input type="text" name="login" value="" id="log" /> </p>
<p><label>Haslo:</label> <input type="password" name="haslo" value="" /> </p>
<div style="text-align:center"><input type="submit" name="action" value="Zaloguj" class="but" /></div>
</form>
</div></div>
</form>
<?php
} else {
echo 'Witaj '.$_SESSION['discofmnick']; echo '<br><br><a href="index.php?page=logout">Wyloguj</a>'; }
?>
</html>
</body>
Plik login.php:
<?php
$login = $_POST['login'];
$haslo = $_POST['haslo'];
if (($login=='admin') AND $haslo=='haslo')
{
$_SESSION['discofmnick']="ddsadsadsadsa";
$_SESSION['discofmhaslo'] = 'haslo';
header("Location: index.php"); }
?>
Co jest tutaj nie tak ?

Dzięki z góry!
Ten post edytował miras 25.07.2012, 12:49:39