[nycphp-talk] Error checking a simple link

Tim Lieberman tim_lists at
Fri Nov 21 18:21:17 EST 2008

header("Location: /some/url/or/other");

There are slightly more proper ways to write that, but that's the jist  
of it.

You'll need to make sure that there's no output before the header  
line, or turn on output buffering to ensure there isn't.


On Nov 21, 2008, at 5:59 PM, Tony Furnivall wrote:

> Hi (Newbie alert)
> I have a link (via a submit button) which ideally allows a user to  
> sign-in to a more secure level of the site. My question is, how do I  
> tell the browser which way to go at the end of the script?
> If there are no errors, go to the next level, but if there are  
> errors, then stay where you are and fix them, or be content with the  
> lower level of access. The validation includes the usual database  
> accesses, and so on. All of it is working fine apart from the  
> niggling question (which way to go).
> I'm certain that this is sufficiently well-documented that I'm just  
> looking it up in the wrong places, or using the wrong search terms.  
> However, it is frustrating not to be able to map an intuitive if ..  
> then .. else construct onto something as fundamental as 'the next  
> page to load is...'.
> Help!
> Tony
> PS  the code for the form includes <form action = "PHP/signin.php">
> and the script presently does all the error checking. However, it  
> has no mechanism for moving past the script.....
> _______________________________________________
> New York PHP User Group Community Talk Mailing List

More information about the talk mailing list