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

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to