Napisałem prosty skrypt logowania na stronę. Można logować się jako admin i user. Jak loguje sie jako user wszystko jest ok. Jak jako admin to nie chce mi działać. Może ktoś powiedzieć co jest nie tak w tym systemie?
kod:
walidate_l.php
<?php require_once "includes/connect.php"; { $login = $_POST['login']; $usr = $getlist3['login']; if ( $fetch ) // jesli user zostanie znaleziony w bazie { { //session_start(); if ($fetch['status'] == 0) { } if ($fetch['status'] == 1) { //session_start(); $_SESSION['login'] = "$usr"; } if ($fetch['status'] >1) { //session_start(); $_SESSION['login'] = "$usr"; } } else { } } else { } } else { } ?>
admin.php
<?php include "includes/base.php"; if ($status >1) { //if (isset ($_SESSION['login'])) ?> <!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=windows-1250" /> <title>Untitled Document</title> </head> <body> <center> <!--TOP--> ... <!--KONIEC STOPKA--> </center> <br /> </body> </html> <? } if ($error == 1){ } else { $adres = 'http://pk.xyx.pl'.'/?er=1'; } ?>
base.php
<? require_once "includes/connect.php"; { //$id = $getlist="Select * from Uzytkownicy WHERE login = '$login'"; if ( $fetch ) { $imie = $fetch['imie']; $status = $fetch['status']; }} else { $error = 1; } ?>
Będę bardzo wdzięczny za pomoc.