cilveks Posted October 27, 2006 Report Share Posted October 27, 2006 (edited) index.php pashaa lapas saakumaa ir <?php session_start(); ?> un taalaak kodaa $sel_user = mysql_query("SELECT * FROM users WHERE user_id='$vards' AND pass='$parole'"); if (mysql_num_rows($sel_user) == 0) { echo "nekaa!"; } else { $_SESSION['loged_in'] = $vards; header('Location: lapa.php'); } lapa.php <?php session_start( ); if (!isset($_SESSION['loged_in'])) { header('Location: index.php'); } ?> Ievadot pareizi paroli un usernami vinjsh visu laiku redirektee uz index.php, bez sessijaam viss darbojas kaa vajag. Edited October 27, 2006 by cilveks Link to comment Share on other sites More sharing options...
andrisp Posted October 27, 2006 Report Share Posted October 27, 2006 Pārliecinājies, ka $_SESSION['loged_in'] ir tiešām tas, ko tu domā ? Link to comment Share on other sites More sharing options...
cilveks Posted October 27, 2006 Author Report Share Posted October 27, 2006 Pārliecinājies, ka $_SESSION['loged_in'] ir tiešām tas, ko tu domā ? :o Tas ir kaa? Tas ko es domaaju, tas ar tas ir, bet man nesanaak :P Link to comment Share on other sites More sharing options...
Kristabs Posted October 27, 2006 Report Share Posted October 27, 2006 print_r($_SESSION) Link to comment Share on other sites More sharing options...
cilveks Posted October 27, 2006 Author Report Share Posted October 27, 2006 Pirmiit meegjinaaju jau otraa lapaa ar echo $_SESSION['loged_in']; un nekaads parametrs netiek nodots(undefined variable loged_in), taapeec ar saku, ka sesijas nedarbojas. print_r($_SESSIONS); Notice: Undefined variable: _SESSIONS in ..lapa.php on line 9 Pirmajaa lapaa viss darbojas kaa naakas, sesijas mainiigo atpaziist(Array ( [loged_in] => janis ) ),bet koliidz redirektee, taa sesija nedarbojas. Link to comment Share on other sites More sharing options...
andrisp Posted October 27, 2006 Report Share Posted October 27, 2006 hm.. varbūt tev ar php konfigurāciju kautkas nav kārtībā ? uzliec defaulto php.ini un pasties vai kas mainās. print_r($_SESSIONS); ? Link to comment Share on other sites More sharing options...
cilveks Posted October 27, 2006 Author Report Share Posted October 27, 2006 print_r($_SESSIONS); ? Mana kljuda. Kodaa ir pareizi, $_SESSION. php.ini defaulto negribu likt, jo ir vairaakas opcijas kuras esmu mainiijis, lai piedabutu straadaat PHP+mysql. Defaultais konfigs nestraadaa prieksh manis. Un php.ini sadaljaa par sessions ir defaultais konfigs. phpinfo() session Session Support enabled Registered save handlers files user Registered serializer handlers php php_binary wddx Directive Local Value Master Value session.auto_start Off Off session.bug_compat_42 Off Off session.bug_compat_warn On On session.cache_expire 180 180 session.cache_limiter nocache nocache session.cookie_domain no value no value session.cookie_lifetime 0 0 session.cookie_path / / session.cookie_secure Off Off session.entropy_file no value no value session.entropy_length 0 0 session.gc_divisor 1000 1000 session.gc_maxlifetime 1440 1440 session.gc_probability 1 1 session.hash_bits_per_character 5 5 session.hash_function 0 0 session.name PHPSESSID PHPSESSID session.referer_check no value no value session.save_handler files files session.save_path no value no value session.serialize_handler php php session.use_cookies On On session.use_only_cookies Off Off session.use_trans_sid 0 0 Link to comment Share on other sites More sharing options...
cilveks Posted October 27, 2006 Author Report Share Posted October 27, 2006 Atradu kam ir identiska probleema http://forums.devnetwork.net/viewtopic.php?t=56631 Kaa solution vinji iesaka paarinstaleet apachi,php utt. Bet es negribu paarinstaleet, veel pamekleeshu probleemas risinaajumu, un paarinstaleeshanu pielietoshu kaa galeejo risinaajumu. Link to comment Share on other sites More sharing options...
cilveks Posted October 27, 2006 Author Report Share Posted October 27, 2006 Atrisinaats! pamainiiju shos parametrus, nezinu kursh bija likteniigais, bet galvenais ka darbojas sesijas. session.bug_compat_42 On session.gc_divisor 100 session.hash_bits_per_character 4 session.use_trans_sid 0 Link to comment Share on other sites More sharing options...
Recommended Posts