Am I doing this wrong? I don't get an output. Here's my code split among two files.
1) my functions file:
<?php
function &LoginUser($un, $pw)
{
$password=md5($pw);
$users=mysql_query("SELECT * FROM user WHERE (username='$un' AND password='$password')");
$user=mysql_fetch_array($users);
if($user)
{
$status = $user[id];
}
else
{
$status = 0;
}
return($status);
}
?>
2) My login file which calls the function file in a require statement:
LoginUser($username, $password);
echo($status);
I get nothing in the echo.
If I do the same echo inside my functions file I get output. How can I use the variable sent back in the return() function?
Thanks!