On Thursday 05 August 2004 10:42, Aaron Todd offered up the following 
tid-bit of information :
<snip>
> The direction I need is how do I go about restricting access to the
> members only pages?  I have been reading up on sessions, which I think
> will be a cool addition to this site, but I still havent found much on
> restrictin access without a username and password.  Currently my login
> and registration pages are located in the root of the domain.  The all
> the members only pages are in a directory called /members/.
>
> Can anyone give me some direction on how I should go about all this.
<snip>

When a user logs in successfully, you could set a session variable (move on 
to cookies if you want them to be able to 'remember' their login) like 
$_SESSION['loggedin'] = true;  Then, in every page in your members section 
(use an include file), do something like this before any output to the 
browser....

if ( ! isset ( $_SESSION['loggedin'] ) || ! $_SESSION['loggedin'] ) {
        header ( "Location : /unauthorized.php" );
        exit;
}

-- 
John C. Nichel
ÃberGeek
KegWorks.com
716.856.9675
[EMAIL PROTECTED]

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

Reply via email to