Why do you need to redirect the user to a different page for login in
the first place?
Just do something like this at the top of each page:
if(!auth_ok()) {
$content = show_login();
die();
}
If the user fails your authentication scheme, you display the login
form... if they pass, you execute the rest of the code on that page.
No redirection = No hosed navigation.
I use a combination of the PEAR::Auth Library for authentication and
PHPGACL for access control in my larger apps.
I instantiate the Auth and PHPGACL classes in a common config file
that's included on all of my pages, and then I just do:
if(!$auth_obj->checkAuth() ||
!$objGACL->acl_check('admin','login','users',$_SESSION['_authsession']['data']['user_id'],'','','',''))
{
echo showLogin();
die();
} elseif ($_GET['logout']==1) {
$auth_obj->logout();
$auth_obj->start();
echo showLogin();
die();
}
If the user is shown the login form, the $auth_obj->checkAuth() call
processes the user's login.
If it's successful, it displays the content.
If the user is already logged in, it processes the credentials in their
session, and displays the content.
Jer wrote:
>I'm working in my first site using authentication and sessions. Users
>can log in from any page on the site.
>
>However...when a user logs in, how do I direct them back to the page
>they were viewing? This would include the variables that are passed to
>the MySQL database.
>
>Is there a way to look back in the browser history a couple of pages?
>
>Jer
>
>
>
>
>
>The PHP_mySQL group is dedicated to learn more about the PHP_mySQL web
>database possibilities through group learning.
>Yahoo! Groups Links
>
>
>
>
>
>
>
>
>
The PHP_mySQL group is dedicated to learn more about the PHP_mySQL web database
possibilities through group learning.
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/php_mysql/
<*> To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/