Class Function Issue
| From: | Jason Bell | Date: | Sun, 17 Mar 2002 06:24:22 +0000 |
| Subject: | Class Function Issue | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-88807@lists.php.net to get a copy of this message | ||
Hi! I'm building a class, and am trying to include an authorization function.... the code
works when used outside of the class, but when I put it inside the class, for some reason my session
variables won't get set. Am I attempting the impossible, or am I missing something that I need
to make this work? Below is the code for the Auth function.
function Auth($username,$password) {
$query = "SELECT id,username,sl FROM KAOPA_users where
username='$username' AND password=PASSWORD('$password')";
$Auth = $this->Query($query);
if ($this->number_returned($Auth) == '1') {
$id = mysql_result($Auth,0,"id");
$uname = mysql_result($Auth,0,"username");
$sl = mysql_result($Auth,0,"sl");
global $HTTP_SESSION_VARS;
$HTTP_SESSION_VARS["id"] = $id;
$HTTP_SESSION_VARS["user"] = $uname;
$HTTP_SESSION_VARS["sl"] = $sl;
}
}