login and logout

Secţiune dedicată începatorilor.

Moderatori: Moderatori, Start Moderator


Avatar utilizator
keepwalking
Average Member
Mesaje: 131
Membru din: Joi Dec 07, 2006 8:35 pm
Localitate: Ploiesti

Mesajde keepwalking » Sâm Dec 09, 2006 3:15 pm


Pushtiu
Average Member
Mesaje: 69
Membru din: Mie Dec 06, 2006 1:03 pm
Contact:

Mesajde Pushtiu » Sâm Dec 09, 2006 3:19 pm


Pushtiu
Average Member
Mesaje: 69
Membru din: Mie Dec 06, 2006 1:03 pm
Contact:

Mesajde Pushtiu » Sâm Dec 09, 2006 3:23 pm


Avatar utilizator
keepwalking
Average Member
Mesaje: 131
Membru din: Joi Dec 07, 2006 8:35 pm
Localitate: Ploiesti

Mesajde keepwalking » Sâm Dec 09, 2006 3:23 pm


Pushtiu
Average Member
Mesaje: 69
Membru din: Mie Dec 06, 2006 1:03 pm
Contact:

Mesajde Pushtiu » Sâm Dec 09, 2006 3:32 pm

uite sursa
<?php
if(!isset($_SESSION['logat'])) $_SESSION['logat'] = 'Nu';
if($_SESSION['logat'] != 'Da')
{
echo 'Pentru a accesa aceasta pagina, trebuie sa va autentificati. <br>
Pentru a va autentifica, apasati <a href="page.php">aici</a><br>';
}
else
{
echo '<font size=1 color=red>Esti logat, <b><i>'.$_SESSION['user'].'</font></b></i>!<br><br>
<a href="logout.php">Iesire</a>';
}
?>

daca vezi tu unde e greseala pls spune-mi

Pushtiu
Average Member
Mesaje: 69
Membru din: Mie Dec 06, 2006 1:03 pm
Contact:

Mesajde Pushtiu » Sâm Dec 09, 2006 3:45 pm

poate sa ma ajute cineva pls

Avatar utilizator
Nebeleizis
Junior Member
Mesaje: 45
Membru din: Sâm Aug 05, 2006 4:11 pm

Mesajde Nebeleizis » Sâm Dec 09, 2006 8:40 pm

in ce afisezi tu nu este nici o eroare de logica. problema este in fisierul care genereaza pagina cu datele cofidentiale (care nu ar trebui sa poata fi accesate). Pui ceva de genul

if(!isset($_SESSION['logat'])) $_SESSION['logat'] = 'Nu';
if($_SESSION['logat'] != 'Da')header("HTTP/1.0 404 Not Found");

la inceputul paginii cu date confidentiale
"The resonable man adapts himself to the world; the unresonable one persists in trying to adapt the world to himself. Therefore all progress depends on the unreasonable man."
George Bernard Shaw

raduion
Average Member
Mesaje: 94
Membru din: Mie Oct 11, 2006 7:30 am

Mesajde raduion » Sâm Dec 09, 2006 10:22 pm


Avatar utilizator
gabyy
Senior Member
Mesaje: 292
Membru din: Joi Feb 24, 2005 2:21 am

Mesajde gabyy » Dum Dec 10, 2006 12:15 am

Sau unset($_SESSION) si session_destroy
Viata e grea,dar trece!


Înapoi la “PHP Incepători”

Cine este conectat

Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 20 vizitatori