I'm having another problem with my member's area script. When someone
logs in, it's supposed to register their username into a session and it
displays fine on the first page. But once you navigate to another part
of the area, it does not tell you you are logged in, instead it gives me
the error I set it to give "You are  not logged in." Here's the code
that checks to see if the user is valid:

function check_valid()
{
  global $valid_user;
  if (session_is_registered("valid_user"))
  {
      echo "<font size='2'>Welcome $valid_user!</font>";
  }
  else
  {
     echo "You are not logged in.";
     exit;
  }  
}

Here's the code that's supposed to save the session:

include_once("funcs.php");
session_start();
if($user && $pass)
{
        if(login($user, $pass))
        {
                $valid_user = $user;
                session_register("valid_user");
        }
        else
        {
                echo "<font face='Arial, Helvetica, sans-serif'
size='3'><center><b>You supplied an invalid username and password combo.
Try again please.</b></center>";
                exit;
        }
}

Please help again!!!

Thanks,
Stephen
http://www.melchior.us
http://php.melchior.us



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to