Hi,
I want to move to another page using url when a certain condition is fulfilled . Any idea ?
Thanks in advance
how to - url ?
Moderator: General Moderators
Re: how to - url ?
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.-
littlecoder
- Forum Commoner
- Posts: 26
- Joined: Fri Oct 17, 2008 4:36 am
Re: how to - url ?
Hi,
Thanks for the reply...But i am getting an error : 'Cannot modify header information - headers already sent'
what shall i do ?
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 ?
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
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 ?
If you absolutely must send headers after something has been printed, use output buffering.
Re: how to - url ?
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
I forgot you can do it in the Apache' htaccess file, read here
- novice4eva
- Forum Contributor
- Posts: 327
- Joined: Thu Mar 29, 2007 3:48 am
- Location: Nepal
Re: how to - url ?
You can use javascript too
viewtopic.php?f=1&t=89847
viewtopic.php?f=1&t=89847