1. Just pass uzeriz to the function, not session("uzeriz"); 2. FYI: you don't need this construct: while($row = mysql_fetch_row($result)){ Based upon the previous tests, there is ONLY 1 entry. Therefore, go with: $row = mysql_fetch_row($result);
-----Original Message----- From: Mantas Kriauciunas [mailto:[EMAIL PROTECTED]] Sent: Monday, March 25, 2002 6:39 AM To: PHP General List Subject: [PHP] [newbie] Something is messed up, anybody can help? Hey PHP General List, Intro: I am creating small login script and few things doesn't work right. Code is hare: admin.php if(isset($subm_login)) { $session["logged"]=0; $session["uzeriz"]=""; $result = mysql_query("select * from uzer where user='$uzr_name' and pass='$uzr_passwd'"); if(!$result) { echo "This error should not be hare. But it sayes that it could not search for your user"; } else { if(mysql_num_rows($result)!=1) { echo "Login Not Found"; } else { while($row = mysql_fetch_row($result)){ $session["uzeriz"]=$row["user"]; $session["logged"]=1; $session["pass"]=$row["pass"]; } } } session_register("session"); } if( $session["logged"]==1 ) { draw_admin_menu($session["uzeriz"]); } if( $session["logged"]==0 ) { draw_login_box(); } -------------- adm_func.php (this file is included in admin.php) function draw_admin_menu($uzer) { global $session; echo "<p>User Logged In</p>\n"; echo "<p>--------------</p>\n"; echo "<p>$uzer</P>\n"; } ------------------------------ Problem: the problem is that i cant see $uzer its empty. nothing is there....what i am doing wrong? all table names and everything is correct but i get empty thing. 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 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php