Hey PHP General List, Well it didn't work with $_session["logged"]
and now i found one more interesting thing. it works if i do like this: ..... $row = mysql_fetch_row($result); $session["uzeriz"]=$uzr_name; $session["logged"]=1; ..... then i pass: ..... draw_admin_menu($session["uzeriz"]); ..... and it works.... so why does $row["user"] is empty? when i pass like this: ..... $row = mysql_fetch_row($result); $session["uzeriz"]=$row["user"]; $session["logged"]=1; ..... ??? P.S thanks to people who is helping me out. :---- Got your email on:Monday, March 25, 2002, 1:12:03 PM writing: :---- eczc> maybe you need $_session["logged"] instead of $session["logged"] eczc> Eric eczc> ----- Original Message ----- eczc> From: "Mantas Kriauciunas" <[EMAIL PROTECTED]> eczc> To: "PHP General List" <[EMAIL PROTECTED]> eczc> Sent: Monday, March 25, 2002 5:59 PM eczc> Subject: Re[2]: [PHP] [newbie] Something is messed up, anybody can help? >> Hey PHP General List, >> >> Well thanks for helping but still i get nothing and i have no idea >> why. I changed the line as you said to: >> >> if( $session["logged"]==1 ) >> { >> draw_admin_menu($uzeriz); >> } >> >> and took out that while. >> It shows the box but the $uzeriz that i pass doesn't show up :/ >> >> maybe anybody see more mistakes? >> >> :---- >> >> Got your email on:Monday, March 25, 2002, 5:45:49 AM writing: >> >> :---- >> RE> 1. Just pass uzeriz to the function, not session("uzeriz"); >> >> RE> 2. FYI: you don't need this construct: while($row = >> RE> mysql_fetch_row($result)){ >> RE> Based upon the previous tests, there is ONLY 1 entry. Therefore, go eczc> with: >> RE> $row = mysql_fetch_row($result); >> >> >> RE> -----Original Message----- >> RE> From: Mantas Kriauciunas [mailto:[EMAIL PROTECTED]] >> RE> Sent: Monday, March 25, 2002 6:39 AM >> RE> To: PHP General List >> RE> Subject: [PHP] [newbie] Something is messed up, anybody can help? >> >> >> RE> Hey PHP General List, >> >> RE> Intro: >> RE> I am creating small login script and few things doesn't work right. >> RE> Code is hare: >> >> RE> admin.php >> >> RE> if(isset($subm_login)) >> RE> { >> RE> $session["logged"]=0; >> RE> $session["uzeriz"]=""; >> RE> $result = mysql_query("select * from uzer where eczc> user='$uzr_name' and >> RE> pass='$uzr_passwd'"); >> RE> if(!$result) { >> RE> echo "This error should not be hare. But it sayes eczc> that it >> RE> could not search for your user"; >> RE> } else { >> RE> if(mysql_num_rows($result)!=1) { >> RE> echo "Login Not Found"; >> RE> } else { >> RE> while($row = mysql_fetch_row($result)){ >> RE> $session["uzeriz"]=$row["user"]; >> RE> $session["logged"]=1; >> RE> eczc> $session["pass"]=$row["pass"]; >> RE> } >> RE> } >> RE> } >> RE> session_register("session"); >> RE> } >> >> RE> if( $session["logged"]==1 ) >> RE> { >> RE> draw_admin_menu($session["uzeriz"]); >> RE> } >> RE> if( $session["logged"]==0 ) >> RE> { >> RE> draw_login_box(); >> RE> } >> >> RE> -------------- >> RE> adm_func.php (this file is included in admin.php) >> >> RE> function draw_admin_menu($uzer) >> RE> { >> RE> global $session; >> RE> echo "<p>User Logged In</p>\n"; >> RE> echo "<p>--------------</p>\n"; >> RE> echo "<p>$uzer</P>\n"; >> RE> } >> >> RE> ------------------------------ >> >> RE> Problem: >> RE> the problem is that i cant see $uzer its empty. nothing is >> RE> there....what i am doing wrong? all table names and everything is >> RE> correct but i get empty thing. >> >> RE> If that is dumb question im sorry :) i am kinda new in this :) >> :---- :------------------------------: Have A Nice Day! Mantas Kriauciunas A.k.A mNTKz Contacts: [EMAIL PROTECTED] Http://mntkz-hata.visiems.lt -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php