I've done this on other platforms ASP,Cold Fusion, but I need to know what's
the best way to do it on PHP.
1. grab username and password from POST vars.
2. select count(*) from users where username = '$username' and
password='$password'... something along these lines
3. if that user exists and password matches, set a flag on the user and send
them to the right page, otherwise increment failed attempts and send them
back to login page.
if (count > 0)
session_register("someflag");
$HTTP_SESSION_VARS["someflag"] = somevalue;
header("Location: secretpage.php");
}
else
session_register("failedattempts");
$HTTP_SESSION_VARS["failedattempts"]++;
header("Location: loginpage.php");
}
but apparently, i can't start/register a session and then redirect. Is
there a better way to do this?
Regards,
Johnny
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]