On Thu, 05 Oct 2006 09:16:17 +0800, Penthexquadium wrote:

> On Thu, 5 Oct 2006 01:17:41 +0700, Groundhog <[EMAIL PROTECTED]> wrote:
> 
>> how can I jump to another page after IF..ELSE statement, for example:
>> 
>> IF (statement == TRUE)
>>    { stay on this page, index.php }
>> ELSE { jump to index2.php}
>> 
>> -- 
>> Come and Visit My Blog
>> http://ubuntu-ku.blogspot.com
>> 
>> -- 
>> PHP General Mailing List (http://www.php.net/)
>> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> if (!statement) {
>     header('Location: index2.php');
>     exit;
> }
> // other codes...

It's recommended (HTTP/1.1 standard requirement) to use a full absolute
path.

header('Location: http://' . $_SERVER['HTTP_HOST'] .
rtrim(dirname($_SERVER['PHP_SELF']), '/') . '/index2.php');

Ivo

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to