You are here: Re: [PHP] making FORM dissapear when successful login « PHP « IT news, forums, messages
Re: [PHP] making FORM dissapear when successful login

Posted by Richard Lynch on 01/06/05 01:50

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация