note 27224 deleted from ref.session by sniper

From: Date: Tue, 21 Jan 2003 03:11:52 +0000
Subject: note 27224 deleted from ref.session by sniper
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-42464@lists.php.net to get a copy of this message
I had a problem with sessions. I solved them with a sample redirection, and I'm happy! If you not familiar with sessions, try it! <? session_start(); if($HTTP_GET_VARS['todo'] == "exit"){ session_unregister("is_logged"); header("Location: $PHP_SELF"); } if($_SESSION['is_logged']){ echo "<a href=$PHP_SELF>fooo barrr</a> | "; echo "<a href=$PHP_SELF?todo=exit>exit</a>"; } elseif($HTTP_GET_VARS['todo'] == "login"){ $is_logged = 1; session_register("is_logged"); header("Location: $PHP_SELF"); } if(!$_SESSION['is_logged']){ echo "<a href=$PHP_SELF?todo=login>login</a>"; } ?>

« previous php.notes (#42464) next »