note 110157 deleted from function.session-start by aharvey
| From: | aharvey@php.net | Date: | Tue, 25 Sep 2012 07:47:13 +0000 |
| Subject: | note 110157 deleted from function.session-start by aharvey | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-191009@lists.php.net to get a copy of this message | ||
Note Submitter: FearTec
----
Worked for me:
<?php
if(isset($_SESSION['myusername'])) {
if(!$_SESSION['myusername']){
//do nothing
print('<div style="text-align:right;"><a
href="/login.php">Login </a> </div>');
} else {
//ok to be here
print('<div style="text-align:right;""><a
href="/logout.php">Log Out: ');
echo($_SESSION['myname']);
print(" (");
echo($_SESSION['myusername']);
print")</a>";
print(' </div>');
}
} else {
print('<div style="text-align:right;"><a
href="/login.php">Login</a> </div>');
}
//ob_end_flush();
?>