login and logout
Moderatori: Moderatori, Start Moderator
- keepwalking
- Average Member
- Mesaje: 131
- Membru din: Joi Dec 07, 2006 8:35 pm
- Localitate: Ploiesti
- keepwalking
- Average Member
- Mesaje: 131
- Membru din: Joi Dec 07, 2006 8:35 pm
- Localitate: Ploiesti
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
<?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
- Nebeleizis
- Junior Member
- Mesaje: 45
- Membru din: Sâm Aug 05, 2006 4:11 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
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
George Bernard Shaw
Cine este conectat
Utilizatori ce ce navighează pe acest forum: Niciun utilizator înregistrat și 18 vizitatori

