oto moje pliki:
plik users.dat
<?php DATA Admin,0033455f990e921b286b9e56698b0fb0,admin test1,5a105e8b9d40e1329780d62ea2265d8a,user abc,900150983cd24fb0d6963f7d28e17f72,user def,4ed9407630eb1000c0f6b63842defa7d jarek,c63a5cfce0a1819ebbe4a19e074356b6 zzz,f3abb86bd34cf4d52698f14c0da1dc60 ccc,9df62e693988eb4e1e1444ece0578579 ?>
index.php
<? include "session.php"; ?> <html> <head> <title>Farmazon Site</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-2"> <link href="style.css" type="text/css" rel="stylesheet"> </style> </head> <body topmargin="40"> <p> </p> <!-- lewa strona --> <tr> <? include "left.php"; ?> </body> </html>
left.php
<center><table width="706" border="0" cellpadding="0" cellspacing="0" height="175"> <tr> <td height="1" colspan="6" valign="top" width="713"><img src="images/flh.gif" width="713" height="159"></td> </tr> <tr> <td height="17" colspan="6" valign="top" width="713"><img src="images/flh_05.gif" width="713" height="17"></td> </tr> </table> <table width="706" border="0" cellpadding="0" cellspacing="0" height="175"> <tr> <td width="15" height="144" valign="top" background="images/flh_09.gif"></td> <td width="167" valign="top" background="images/cgb.gif" bgcolor="363636"> <p align="left" style="margin-top: 0; margin-bottom: 0"> <p align="left" style="margin-top: 0; margin-bottom: 0"> <? if(!auth()) { include "login.frm"; } else { print "» <a href="index.php?page=logout&".SESID."">Wyloguj " . $_SESSION["USER_LOGIN"] . "</a>"; } ?> <p align="left" style="margin-top: 0; margin-bottom: 0"> </p> <p align="left" style="margin-top: 0; margin-bottom: 0"><font face="Verdana" color="#697C9C"> »<b> Menu:</b></font><br> </p> <p align="left" style="margin-top: 0; margin-bottom: 0"> - <a href="index.php?page=download">Download</a><br> <img src="images/flh_42.gif" width="140" height="3"><br> - <a href="index.php?page=tut">Tutoriale</a><br> <img src="images/flh_42.gif" width="140" height="3"><br> - <a href="index.php?page=skrypty">Skrypty</a><br> <img src="images/flh_42.gif" width="140" height="3"><br> - <a href="index.php?page=linki">Linki</a><br> <img src="images/flh_42.gif" width="140" height="3"><br> - <a href="index.php?page=arty">Atykuly</a><br> <img src="images/flh_42.gif" width="140" height="3"><br> - <a href="#">Cos</a></p> <p align="left" style="margin-top: 0; margin-bottom: 0"> </p> </td> <td width="4" valign="top" background="images/flh_11.gif" height="144"> </td> <td width="1" valign="top" background="images/flh_18.gif" height="144"><img src="images/flh_18.gif" width="2" height="130"></td> <td width="512" valign="top" background="images/cgb.gif" bgcolor="363636" height="144"> <p align="left" style="margin-top: 0; margin-bottom: 0"> </p> <p align="left" style="margin-top: 0; margin-bottom: 0"> <? if($page=="") $page="link1"; { include "default.php"; } else { include_once $page.".php"; } ?></td> <td width="17" valign="top" background="images/flh_14.gif" height="144"></td> </tr> <tr> <td height="15" colspan="6" valign="top" width="715"><IMG SRC="images/flh_51.gif" WIDTH=713 HEIGHT=15 ALT=""></td> </tr> </table> </center> </body> </html>
to mi sie pojawia
<?php ?>
z funkcji
php:
<?php ?>
to jest plik odpowiedzialny za logowanie func.php
<? #definicje stalych # zaloguj user-a function login($login, $passwd) { foreach($line as $temp) { { $_SESSION["USER_AUTH"] = True; $_SESSION["USER_LOGIN"] = $_POST["login"]; return True; } } return False; } # wyloguj user-a function logout() { $_SESSION["USER_AUTH"] = False; $_SESSION["USER_LOGIN"] = Null; } # czy użytkownik istnieje function user_exists($login) { foreach($line as $temp) { } return False; } # dodaje nowego użytkownika function add_user($login, $passwd) { } # sprawdza czy zalogowany function auth() { return ($_SESSION["USER_AUTH"] == True); } ?>
i ostatni session.php
<? # start sesji # biblioteka z funkcjiami include "func.php"; # logowanie, wylogowanie itp switch ($page) { case "login" : break; case "logout" : logout(); break; } ?>
i mam problem nie wyswietla mi USER_LEVEL
powinno mi odczytac czy jestem admin czy user z fuckcji:
<?php ?>
jednak nie wyswietal, ze jest adminem lub userem
w czym moze byc problem? sesje?