Page Redirect after Error Message is Output to the Browser

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
makamo66
Forum Newbie
Posts: 24
Joined: Wed May 12, 2010 6:13 pm

Page Redirect after Error Message is Output to the Browser

Post by makamo66 »

(This topic is very similar to another posting named: php mail form with redirect to same page)

I know that you aren't supposed to output anything to the browser before using the header location function but what if you need to show an error message? If there is an error, for example, an invalid email address, then I want to show an error message and go back to the form submission page. After all of the errors have been corrected, I want to redirect to the next page. However since I already sent an error message, I can't send a header. Is there a way to do this without resorting to javascript?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Page Redirect after Error Message is Output to the Brows

Post by requinix »

No.

Well, yeah, with a <meta> refresh, but,

Why not display the message on the form itself?
Post Reply