Re: Where to insert a phrase in the right place
| From: | Jan Brucek | Date: | Tue, 10 Apr 2007 09:02:34 +0000 |
| Subject: | Re: Where to insert a phrase in the right place | ||
| References: | 1 2 3 4 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-252398@lists.php.net to get a copy of this message | ||
Hi, it seems that you set the $_SESSION['greeted'] variable and
do not unset it anywhere.
If user wants to log-in, and his credentials are OK, you then create
session and set this varaible you want. If it isn't OK, you need to
unset the variable or/and destroy the session so that the variable
won't be set to 1 any more.
Then, you need also to have some logout form/page/whatever to destroy
the session in case user wants to. And unset the variable accordingly.
Hope that helps.
J.
Mário Gamito wrote:
Hi, André Medeiros wrote:<?php session_start(); if(!isset($_SESSION['greeted'])) { echo "Welcome"; $_SESSION['greeted'] = 1; } ?>It doesn't work :( if ($_SESSION['greeted'] == 1) print('Welcome ' . $name); $_SESSION['greeted'] is always equal to 1 as set in the beginning of the file. http://www.telbit.pt/2/login.php Warm Regards