Jackal Posted May 10, 2006 Report Share Posted May 10, 2006 Nu man ir šitas skriptiņš http://paste.php.lv/3732. Problēma ir tāda, ka tad ja lietotājs nav ielogojies, tad parāda, ka nav definēts logged, jo nav ievietota sessija. Kā lai uztaisa tā, lai viņš neņemtu vērā to if($_SESSION['logged']==true), ja lietotājs nav ielogojies? Link to comment Share on other sites More sharing options...
Delfins Posted May 10, 2006 Report Share Posted May 10, 2006 if (!empty($_SESSION['logged'])) Link to comment Share on other sites More sharing options...
Jackal Posted May 10, 2006 Author Report Share Posted May 10, 2006 Šitas variants ar neder viņš vienalga parāda, ka nav definēts logged Link to comment Share on other sites More sharing options...
v3rb0 Posted May 10, 2006 Report Share Posted May 10, 2006 isset() Link to comment Share on other sites More sharing options...
Delfins Posted May 10, 2006 Report Share Posted May 10, 2006 (edited) Šitas variants ar neder viņš vienalga parāda, ka nav definēts logged ko nu muldi... 100p, ka citā vietā tev to saka... Pirms kaut ko saki, pārliecinies vai tas, ko tu saki - ir patiesība no warning is generated when the variable is not set Edited May 10, 2006 by Delfins Link to comment Share on other sites More sharing options...
Vebers Posted May 10, 2006 Report Share Posted May 10, 2006 (edited) if(isset($_SESSION['logged']) && $_SESSION['logged']==true) { //ir ielogojies } Edited May 10, 2006 by MakaTaNaw Link to comment Share on other sites More sharing options...
Delfins Posted May 11, 2006 Report Share Posted May 11, 2006 MakaTaNaw => tieši tāpēc tikai uztaisīta empty() f-ja lai šito penteri nerakstītu... Link to comment Share on other sites More sharing options...
Vebers Posted May 11, 2006 Report Share Posted May 11, 2006 Delfins -> mans variants ir vnk alternatīva... Link to comment Share on other sites More sharing options...
Recommended Posts