![]() |
Pages (2): « 1 [2] Show 150 posts per page |
.dsy:it. (http://www.dsy.it/forum/)
- Tech (http://www.dsy.it/forum/forumdisplay.php?forumid=189)
-- [PHP] Undefinied variable (http://www.dsy.it/forum/showthread.php?threadid=14520)
Originally posted by fabpicca
se metti in ogni pagina session_start() , come del resto suppongo tu stia facendo
Originally posted by Flyzone
Esatto, tralasciando la sintassi php è più o meno così:
session_start();
se $_SESSION['username']="" -->Ti devi loggare
altrimenti {
do query_sql = SELECT * FROM users WHERE username = $_SESSION['username'] AND user_level='livello root';
se (query_sql > 0_risultati) allora --> codice x pagina "root"
altrimenti --> codice x pagina "utenti normali"
}
al logout: session_destroy();
Così in ogni pagina. Può andare come logica?
__________________
my website?|ubuntu linux|get Firefox|grazie Polonia |bagdad sour
"Come va che non ha le corna e le zampe di Caprone?" gli opposi. "Oh, Giuvà", mi disse il prete "adesso non si usa più.Satana è furbo". (I.Silone, Fontamara)
"Al giorno d'oggi non bisogna essere intelligenti, perchè la gente si offende" (un ubriacone)
"close your eyes / pay the price / for your paradise" (DM) "whatever you want to change/you'd better start changing it in your mind" (Transatlantic)
Originally posted by Flyzone
Non uso i cookies, e non c'è nemmeno il passaggio di parametri negli url (che, se non sbaglio, va un pò contro la sicurezza e deve utilizzare variabili globali no?), eppure il tutto funziona indi presumo che le sessioni stiano in memoria visto che richiamo i dati da $_SESSION e visto che appena chiudo il browser e lo riapro la sessione è morta.
__________________
» Collect some stars to shine for you, and start today ‘cause there are only a few. _ (In Flames)
» Don't stop for nothing, it's full speed or nothing! I'm taking down, you know, whatever is in my way! _ ('tallica)
» I am my own god, I do as I please. _ (Pain)
» Ninetynine, ninetynine knives! Ninetynine knives inside! Nobody gets out alive! _ (The Haunted)
Web: http://www.negativesignal.com - ICQ# 171585477 - Death to software patents! And TCPA too! "e uno!", diceva il boia.
Riporto informazioni utili da www.php.net [ http://it.php.net/manual/en/ref.session.php ]
A visitor accessing your web site is assigned an unique id, the so-called session id. This is either stored in a cookie on the user side or is propagated in the URL.
The session module cannot guarantee that the information you store in a session is only viewed by the user who created the session. You need to take additional measures to actively protect the integrity of the session, depending on the value associated with it.

__________________
» Collect some stars to shine for you, and start today ‘cause there are only a few. _ (In Flames)
» Don't stop for nothing, it's full speed or nothing! I'm taking down, you know, whatever is in my way! _ ('tallica)
» I am my own god, I do as I please. _ (Pain)
» Ninetynine, ninetynine knives! Ninetynine knives inside! Nobody gets out alive! _ (The Haunted)
Web: http://www.negativesignal.com - ICQ# 171585477 - Death to software patents! And TCPA too! "e uno!", diceva il boia.
Originally posted by korn
Tu CREDI di non usare i cookies, in realtà il server scrive l'ID della sessione in un cookie sul client, ed è attraverso tale cookie che, cambiando pagina, lo riconosce e gli riassegna le proprie variabili $_SESSION.

Originally posted by Flyzone
Da qui a pensare che siano in memoria il passo è breve
| All times are GMT. The time now is 22:06. | Pages (2): « 1 [2] Show all 21 posts from this thread on one page |
Powered by: vBulletin Version 2.3.1
Copyright © Jelsoft Enterprises Limited 2000 - 2002.