[newbie] Something is messed up, anybody can help?
| From: | Mantas Kriauciunas | Date: | Mon, 25 Mar 2002 12:39:02 +0000 |
| Subject: | [newbie] Something is messed up, anybody can help? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-90007@lists.php.net to get a copy of this message | ||
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:
Mantuks@attbi.com
Http://mntkz-hata.visiems.lt