Mikijs Posted February 13, 2008 Report Share Posted February 13, 2008 Sveiki, taisu vienu lapinju un nevaru saprast kas nav kartiba.. runa ir par login. if(iMEMBER){ /*------------------------------------------------+ + Uzrada profila info -+ +------------------------------------------------*/ include "profils.php"; }else{ /*------------------------------------------------+ + Login process, parbaudes etc -+ +------------------------------------------------*/ if ($_POST['login']){ $login_sql=dbquery("SELECT * FROM ".PREF."lietotaji WHERE login='".$_POST['login']."' AND parole='".md5($_POST['parole'])."'"); if(dbrows($login_sql)){ $login_data=dbarray($login_sql); $_SESSION['id'] = $login_data['id']; dbquery("INSERT INTO ".PREF."online ( sesip, pw ) values( '".$_SERVER['REMOTE_ADDR']."', '".md5($_POST['parole'])."' )"); redirect("index.php"); }else{ echo "<div align='error' align='center'>Login dati aizpildīti nepareizi!</div>"; } } login(); } if ($_SESSION['id']){ $ses_lg=dbquery("SELECT * FROM ".PREF."lietotaji WHERE id = '".$_SESSION['id']."'"); $userdata=dbarray($ses_lg); define("iMEMBER", $userdata['id']); $_SESSION['id'] = iMEMBER; } Jautajums sekojosh.. Kapec kad ienaku login sadala man rada profila lapu. Pietam tukshu.. jo es tak nesu ielogojies! Paldies.. Link to comment Share on other sites More sharing options...
bubu Posted February 13, 2008 Report Share Posted February 13, 2008 Ko nozīmē "ienākt login sadaļā"? Padomā, kas notiek, ja $_SESSION['id'] ir false, un iMEMBER konstante netiek uzdefinēta - īpaši tajā if (iMEMBER). Un kāpēc nelieto parastus mainīgos - $iMEMBER = $userdata['id']; ? Link to comment Share on other sites More sharing options...
mounkuls Posted February 13, 2008 Report Share Posted February 13, 2008 (edited) Kapec kad ienaku login sadala man rada profila lapu. Pietam tukshu.. jo es tak nesu ielogojies! Galīg nesapratu... Kāpēc tukšu profile.php izpildi rāda netaisos zīlēt. Ja rāda profils.php faila rezultātu, vēl jo trakāk ja vienmēr, sanāk, ka esi definējis iMEMBER kā true jau sākumā un nekas nemainās laikam. Edited February 14, 2008 by mounkuls Link to comment Share on other sites More sharing options...
Recommended Posts