<?php
include ("config/db.php");
if (!isset($_SESSION['login'])) { if ($_POST['submit']) {
$haslo = md5($_POST['haslo']);
$db = mysql_query("SELECT * FROM users WHERE login='$login' and haslo='$haslo' and active=0");
echo '<span class="blad">Nie aktywowałeś jeszcze swojego konta.</span>'; }
$db = mysql_query("SELECT * FROM users WHERE login='$login' and haslo='$haslo' and active=1");
$_SESSION["login"] = $informacja["login"];
header('Location: index.php '); } else {
echo '<span class="blad">Podane dane są nieprawidłowe!</span>'; }
}
} else {
header('Location: index.php'); }
if ($_GET["wylogowanie"] == "tak") {
header('Location: index.php'); }
?>
Powyżej prezentuje login.php , a poniżej index.php
<?php
include('config/db.php');
?>
<?php include('templates/header.php'); ?>
<?php
?>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="ContentType" content="text/html; charset=utf-8" />
</head>
<body>
<form action="login.php" method="post">
<table>
<input type="hidden" name="submit" value="TRUE" />
<tr>
<td>Login:</td>
<td><input type='text' name='login' maxlength='20'></td>
</tr>
<tr>
<td>Hasło:</td>
<td><input type='password' name='haslo' maxlength='30'></td>
</tr>
<tr>
<td><input type='submit' value='Zaloguj się'></td>
</tr>
</table>
</form>
</body>
</html>
<?php include('templates/footer.php'); ?>
Krótko mówiąc. Gdy jestem na stronie główne(index.php) i wpisuje dane przenosi mnie na login.php i mam białą stronę chodź mam ustawione przekierowania na stronę główna. Oznacza to, że coś nie działa. Dodałem formularz do login.php i gdy wpisuje tam dane wyskakuje błąd ' Podane dane są nieprawidłowe ' choć są dobre i konto mam nieaktywne, a więc powinno wyskoczyć ' Aktywuj swoje konto '.
Ten post edytował Deotho 13.05.2012, 18:35:48