Witam. Chciałem zrobić plik nagłówka i go potem używać ciągle i brakuje mi już w sumie tylko jednej rzeczy. Ma on działać tak że jest w nim menu a w dodatku w prawym górnym rogu jeśli użytkownik nie jest zalogowany jest system logowanie i to działa ale później jak się już zaloguje to w tamtym miejscu ma być "moje konto" i "wyloguj" i w tym tkwi problem bo po zalogowaniu mam informacje "Przykro nam, ale użytkownik o podanym identyfikatorze nie istnieje." Kod wygląda tak:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css" href="style.css" />
</head>
<body>
<div id="glowna"><a href="http://www.html.net/">Strona główna</a></div>
<div id="terminarz"><a href="http://www.html.net/">Terminarz</a></div>
<div id="tabela"><a href="http://www.html.net/">Tabela</a></div>
<div id="regulamin"><a href="http://www.html.net/">Regulamin</a></div>
<div id="kontakt"><a href="http://www.html.net/">Kontakt</a></div>
<?php
require 'config.php';
require_once 'user.class.php';
if ($_POST['send'] == 1) {
if (!$login or
empty($login)) { die ('<p class="error">Wypełnij pole z loginem!</p>'); }
if (!$pass or
empty($pass)) { die ('<p class="error">Wypełnij pole z hasłem!</p>'); }
$pass = user::passSalter($pass);
if ($userExists[0] == 0) {
echo '<p class="error">Użytkownik o podanym loginie i haśle nie istnieje.</p>'; }
else {
$user = user::getData($login, $pass);
$_SESSION['login'] = $login;
$_SESSION['pass'] = $pass;
echo '<p class="success">Zostałeś zalogowany. Możesz przejść na <a href="index.php">stronę główną</a></p>'; }
}
else {
if (!user::isLogged()) {
?>
<form method="post" action="">
<label for="login">Login:</label>
<input type="text" name="login" maxlength="32" id="login" />
<label for="pass">Hasło:</label>
<input type="password" name="pass" maxlength="32" id="pass" /><br />
<input type="hidden" name="send" value="1" />
<input type="submit" value="Zaloguj" />
</form>
<?php
}
else {
$id = $_GET['id'];
if ($userExist[0] == 0) {
die ('<p>Przykro nam, ale użytkownik o podanym identyfikatorze nie istnieje.</p>'); }
?>
<div id="Wyloguj"><a href="logout.php">Wyloguj</a></div>
<?php
$profile = user::getDataById ($id);
}
}
require 'footer.php';
?>