Re: making FORM dissapear when successful login

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



JHollis wrote:
> I had this code working the way i wanted it to (as far as correct
> username and password allowing successful login)...but what i want to
> happen now is when a user successfully logs it it will make the login
> form disappear and just say successfully logged in or welcome user and a
> link below it so they can log off and make the form re-appear.  Below is
> the code that i have where i tried to get it to disappear on successful
> login, but it stays disappeared all the time.  Can someone please point
> out what im doing wrong.  I have tried everything i can think of...and
> nothing works.  Im a PHP newbie...so im sure some of you might get a
> laugh out of this...if it is real easy.

I would *NOT* use break; to get out of the successful login...

Just move everything else inside the else{ } block if you don't want it to
appear.

After they *DO* login, perhaps use http://php.net/session_start so they
can *stay* logged in.  You'll need to move the password check (and
database connection and so on) to be *ABOVE* all the HTML stuff -- to the
very tip-top of the file.

Then, to log them out, you can use the code from
http://php.net/session_destroy

For sure, don't send stuff through as ?_SERVER[username]=xxx

$_SERVER is for the web server to fill in, not you.

You'll just confuse yourself (next week/month/year) and any other
programmer if you start polluting $_SERVER with your own stuff.

-- 
Like Music?
http://l-i-e.com/artists.htm

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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux