|
| |
Displaying error message after using the header function
View related threads:
(in this forum
| in all forums)
|
Logged in as: Guest
|
|
|
kelsey720
Posts: 6 Joined: 7/12/2009 Status: offline
|
Displaying error message after using the header function - 7/23/2009 22:07:37
Hey all. I'm new to php but understand it quite well. I am having a user login on one page and if the login fails the user is redirected to another login page. I am using the header function to redirect the user. What I am having difficulty writing (and I'm sure its really simple) is an error message displayed on the second login page telling the user that their information is invalid. Any help is appreciated. Thanks.
|
|
|
|
ou812
Posts: 1705 Joined: 1/5/2002 From: San Diego Status: offline
|
RE: Displaying error message after using the header fun... - 7/23/2009 23:54:14
Hard to say without seeing what it is you're doing. When failing, do you set a message then? and then redirect to a page? You could do something as simple as using a session variable to store your message when the attempt is failed, and then display it on the login page if they failed. Set the message $_SESSION['login_msg'] = 'Login Failed! ' Display the message <?PHP echo $_SESSION['login_msg'] ?> clear the message <?PHP unset($_SESSION['login_msg']); ?> Or if they fail and you redirect to a failed login page then just display whatever, without using underlying PHP
_____________________________
-brian Black Holes suck. EnterpriseDB: Enterprise-class relational database management system PostgreSQL: The world's most advanced open source database
|
|
New Messages |
No New Messages |
Hot Topic w/ New Messages |
Hot Topic w/o New Messages |
Locked w/ New Messages |
Locked w/o New Messages |
|
Post New Thread
Reply to Message
Post New Poll
Submit Vote
Delete My Own Post
Delete My Own Thread
Rate Posts
|
|
|