php-general | 2003022
Date: 02/18/03
- Next message: Justin French: "Re: [PHP] is "http://username:password <email protected>/secure_area/" secure ?"
- Previous message: Vitaly: "[PHP] compiling php with -DEAPI"
- In reply to: Rich Gray: "RE: [PHP] $_SESSIONS and printing off.."
- Next in thread: Ernest E Vogelsinger: "Re: [PHP] $_SESSIONS and printing off.."
- Reply: Ernest E Vogelsinger: "Re: [PHP] $_SESSIONS and printing off.."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Uh, sorry for the bad explanation Rich.. Again;
<?php
session_start();
if (isset($_SESSION['username']) && !empty($_SESSION['username'])){
echo 'Welcome '.$_SESSION['username'].', you are still logged in.';
echo $_SESSION['woonplaats'];
}
else{
header ( "Location: login.htm" );
}
?>
This is working fine. But i've set $_SESSION['level'] to value 2 (that's
done in the php file that calls this one). Now i want the above code to
check for the level and if is not equal to two than go to the else (back to
login.htm) statement..
better explained??? ;>
Thanks,
Frank
----- Original Message -----
From: "Rich Gray" <rich <email protected>>
To: "Frank Keessen" <fkeessen <email protected>>; <php-general <email protected>>
Sent: Tuesday, February 18, 2003 1:25 PM
Subject: RE: [PHP] $_SESSIONS and printing off..
> Um... how about...
>
> echo 'Welcome '.$_SESSION['username'].', you are still logged in and your
> authentication level is '.(isset($_SESSION['level']) ? $_SESSION['level']
:
> 'unknown');
>
> Or am I missing something here?
>
> Rich
>
> > -----Original Message-----
> > From: Frank Keessen [mailto:fkeessen <email protected>]
> > Sent: 18 February 2003 12:15
> > To: Rich Gray; php-general <email protected>
> > Subject: Re: [PHP] $_SESSIONS and printing off..
> >
> >
> > Thanks,
> >
> > But then another question;
> >
> > if (isset($_SESSION['username']) && !empty($_SESSION['username'])) {
> > > echo 'Welcome '.$_SESSION['username'].', you are still logged in.';
> >
> >
> > I want also checked if the level of authentication = 2; for example
> > User Frank = level 1
> > User Rich = level 2
> >
> > I've set $_SESSION['level'] to 2 but how can i check that with the above
> > line?
> >
> > Thanks for your help,
> >
> > Frank
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
-- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
- Next message: Justin French: "Re: [PHP] is "http://username:password <email protected>/secure_area/" secure ?"
- Previous message: Vitaly: "[PHP] compiling php with -DEAPI"
- In reply to: Rich Gray: "RE: [PHP] $_SESSIONS and printing off.."
- Next in thread: Ernest E Vogelsinger: "Re: [PHP] $_SESSIONS and printing off.."
- Reply: Ernest E Vogelsinger: "Re: [PHP] $_SESSIONS and printing off.."
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

