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 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 user='$uzr_name' and RE> pass='$uzr_passwd'"); RE> if(!$result) { RE> echo "This error should not be hare. But it sayes 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> $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 :) RE> :------------------------------: RE> Have A Nice Day! RE> Mantas Kriauciunas A.k.A mNTKz RE> Contacts: RE> [EMAIL PROTECTED] RE> Http://mntkz-hata.visiems.lt :------------------------------: 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