Re: Mutiple header statements?
| From: | ed at home dot homes2see dot com | Date: | Wed, 30 Oct 2002 13:24:35 +0000 |
| Subject: | Re: Mutiple header statements? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-122058@lists.php.net to get a copy of this message | ||
On Wed, 30 Oct 2002, Marek Kilimajer wrote:
> I suppose this is just an excerpt, could you paste some more code here?
>
> ed@home.homes2see.com wrote:
>
> >On Wed, 30 Oct 2002, Rick Emery wrote:
> >><?
> >>
> >>if ($_POST['var'] == "this") {
> >>header("Location: scipt1.php"); exit;}
> >>
> >>if ($_POST['var'] == "that") {
> >>header(Location: script2.php"); exit; }
My original code is:
<?
if ($_POST['var'] == "this") {
header("Location: script1.php"); }
if ($_POST['var'] == "that") {
header("Location: script2.php"): }
?>
<Stuff to do here if neither of these conditions match.>
What I'm trying to accomplish here is to check the value of a variable
against these two conditions at the very top of my script. If any one
condition matches is sends the user to it's respective script as defined
above. If neither of these conditions match it continues on with
the script. I'm getting header already sent errors if I choose the
variable that makes the second condition true. It works just fine If I
choose to make the first condition true or choose to make both conditions
false.
Thanks,
Ed