Re: PHP jump to other page

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

> On Thu, 5 Oct 2006 01:17:41 +0700, Groundhog <linuxmurah@xxxxxxxxx> 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


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux