OutFront Forums
     Home    Register     Search      Help      Login    

Follow Us
On Facebook
On Twitter
RSS
Via Email

Recent Posts
Todays Posts
Most Active posts
Posts since last visit
My Recent Posts
Mark posts read

Sponsors
Shopping Cart Software
Ecommerce software integrated into Frontpage, Dreamweaver and Golive templates. No monthly fees and available in ASP and PHP versions.
Website Templates
We also have a wide selection of Dreamweaver, Expression Web and Frontpage templates as well as webmaster tools and CSS layouts.
Frontpage website templates
Creative Website Templates for FrontPage, Dreamweaver, Flash, SwishMax

 

Displaying error message after using the header function

 
View related threads: (in this forum | in all forums)

Logged in as: Guest
Users viewing this topic: none
Printable Version 

All Forums >> Web Development >> ASP, PHP, and Database >> Displaying error message after using the header function
Page: [1]
 
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

(in reply to kelsey720)
Page:   [1]

All Forums >> Web Development >> ASP, PHP, and Database >> Displaying error message after using the header function
Page: [1]
Jump to: 1





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