--- adwinwijaya <[EMAIL PROTECTED]> wrote: > if($foo == 'something'){ > header('Location:to_another_page.php') ; > }else > { > do another thing in here > } > > header('Location:to_previous_page.php'); > > > I got a problem ... when $foo == 'something' .. it wont redirect me > to to_another_page.php .... but if I put die(); after calling > header(); .. it will work ... > > is this the bug ?
Nope. As others have pointed out, your Location header is improperly formed. However, your immediate problem is that, regardless of whether $foo == 'something', you *always* set the Location header to to_previous_page.php. So, even if you set it to to_another_page.php previously, you're overwriting it. Hope that helps. Chris ===== Chris Shiflett - http://shiflett.org/ PHP Security - O'Reilly Coming mid-2004 HTTP Developer's Handbook - Sams http://httphandbook.org/ PHP Community Site http://phpcommunity.org/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php