Page 1 of 1
how to - url ?
Posted: Sun Nov 09, 2008 12:50 am
by littlecoder
Hi,
I want to move to another page using url when a certain condition is fulfilled . Any idea ?
Thanks in advance
Re: how to - url ?
Posted: Sun Nov 09, 2008 12:57 am
by Syntac
Code: Select all
header( "Location: another_web_page.php" ); // HTTP 1.1 says header URLs should be absolute, but all or most user agents can take relative ones as well.
Re: how to - url ?
Posted: Sun Nov 09, 2008 1:05 am
by littlecoder
Hi,
Thanks for the reply...But i am getting an error : 'Cannot modify header information - headers already sent'
what shall i do ?
Re: how to - url ?
Posted: Sun Nov 09, 2008 4:36 am
by Ziq
PHP Manual:
Remember that header() must be called before any actual output is sent, either by normal HTML tags, blank lines in a file, or from PHP. It is a very common error to read code with include(), or require(), functions, or another file access function, and have spaces or empty lines that are output before header() is called. The same problem exists when using a single PHP/HTML file.
header()
In full version of this error you can see file and line where output started
Re: how to - url ?
Posted: Sun Nov 09, 2008 10:25 am
by Syntac
If you absolutely must send headers after something has been printed, use
output buffering.
Re: how to - url ?
Posted: Mon Nov 10, 2008 2:43 am
by Rovas
Maybe your hosting company blocked the modifications of the headers, it happened to me too. Contact them if you don' t succeed.
I forgot you can do it in the Apache' htaccess file, read
here
Re: how to - url ?
Posted: Mon Nov 10, 2008 5:00 am
by novice4eva
You can use javascript too
viewtopic.php?f=1&t=89847