plik index.php
<?php include_once('config.php'); include_once('logowanie.php'); ?> <?php if($_SESSION['logowanie'] == 'poprawne') { echo '<h2>Panel Administracyjny</h2><br><a href="index.php">Home</a> | <a href="kick_pilot.php">Kick Pilot</a> | <a href="konfiguracja.php">Konfiguracja Danych Pilota</a>'; if ($row['typ'] =="2" ) else } else { } ?>
plik logowanie.php
<?php include_once('config.php'); ?> <?php $query = @mysql_query('SELECT * FROM uzytkownicy WHERE login = "'.$_POST['login'].'" AND haslo = "'.$_POST['haslo'].'"') or die(mysql_error()); $_SESSION['logowanie'] = 'poprawne'; $_SESSION['user'] = $row['id']; } else { $_SESSION['logowanie'] = 'Błędny login lub hasło!'; } } } function logowanie() { if($_SESSION['logowanie'] == 'poprawne') { $string .= '<input type="submit" name="wylogowanie" value="Wyloguj" />'; $string .= '</form>'; } else { $string .= '<ul style="list-style-type: none; margin: 0; padding: 0;">'; $string .= '<li>Login: <input type="text" name="login" /></li><br>'; $string .= '<li>Haslo: <input type="password" name="haslo" /></li><br>'; $string .= '<li><input type="submit" name="logowanie" value="Logowanie" /></li>'; $string .= '</ul>'; $string .= '</form>'; } return $string; } ?>
W configu sa tylko dane do bazy.
DONE, SAM WYMYSLILEM, PROSZE ZAMKNAC I USUNAC.