Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [php] Problem z level'em dla uzytkownika
Robert
post
Post #1





Grupa: Zarejestrowani
Postów: 117
Pomógł: 0
Dołączył: 2.05.2003

Ostrzeżenie: (0%)
-----


Chcialbym by ktos sprawdzil mi moj kod bo gdzies jest blad ale nie wiem gdzie. Kod odpowiada za poziom dostepu. W pliku z userami jest zmienna $lev = "3" - dla administratora.
[php:1:6a2f8ce3e7]<?php if(session_is_registered("log")){
if($lev == "3") {
?>
Witaj [<font color="#888888"><?=$_SESSION["log"];?></font>]
<?php }
}?>[/php:1:6a2f8ce3e7]

fragment loginu bez formularza. Formularz znajduje sie w tym samym pliku[php:1:6a2f8ce3e7]<?php
if(!empty($_POST)) {
if(file_exists('includes/users/'.$_POST['login'].'.dat')) {
include('includes/users/'.$_POST['login'].'.dat');
if(isset($log) && isset($pass) && isset($lev)) {
if($pass = $_POST['password']) {
session_register('log');
header('location: index.php?page=download&'.SID);
exit();
} else {
echo 'Nieprawid&sup3;owy login!'; }
}
}
}
?> [/php:1:6a2f8ce3e7]

Bede wdzieczny za pomoc.

Pozdrawiam
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
Robert
post
Post #2





Grupa: Zarejestrowani
Postów: 117
Pomógł: 0
Dołączył: 2.05.2003

Ostrzeżenie: (0%)
-----


Cytat
Cytat

Przy użyciu $_SESSION (lub $HTTP_SESSION_VARS) nie powinno się używać session_register(), session_is_registered() i session_unregister().  


Mam na mysli czy $_POST moze byc zamiast $_SESSION, jestem jeszcze na 1 levelu w php wiec moge bredzic (IMG:http://forum.php.pl/style_emoticons/default/smile.gif)
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 3.10.2025 - 00:21