$_SESSIONS and printing off..
| From: | Frank Keessen | Date: | Tue, 18 Feb 2003 08:59:44 +0000 |
| Subject: | $_SESSIONS and printing off.. | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-135971@lists.php.net to get a copy of this message | ||
Hi All,
I'm a little bit confused and it's maybe a newbie question but maybe you can help me out;
A user is login in and after username password check it will redirects to this page
<?php
session_start();
if (isset($_SESSION['username'])){
$username = $_SESSION['username'];
echo 'Welcome, you are still loged in.';
echo $username;
}
else{
header ( "Location: login.htm" );
}
?>
Question is; is this the way to print of his username?
$username = $_SESSION['username'];
Echo $username
Or has anyone some alternatives..
This is working o.k. but in my opinion it's a little bit quick and dirty?
Thanks for the comments and suggestions!
Frank