The PHP header function allows redirection of the browser, among other cool things.
Example redirecting the browser to php-scripts.com homepage:
Writing about PHP scripting since 12/99. Learn something new every day.
PHP Diary // Home
Thursday, September 22nd, 2005
The PHP header function allows redirection of the browser, among other cool things.
Example redirecting the browser to php-scripts.com homepage:
I try tu use it but I got this message :
Warning: Cannot modify header information - headers already sent by (output started at C:\Inetpub\wwwroot\PGNomo\logon.php:5)
Thanks in advance.
on October 28th, 2005 at 2:15 pm | #Link CommentJorge - you can’t have any whitespace or HTML before the headers are sent. Make sure nothing is printing, HTML or whitespace is happening before that function call.
on October 28th, 2005 at 8:25 pm | #Link Commentdo it before the html tags.
on November 18th, 2005 at 4:25 am | #Link Commentthat sent the header info(s) before, so thats why its saying “headers already sent by ….”.
tried several scripts but all failed with the same ‘header already sent’ error. Finally got the one below to work but the ‘else’ statement still gives the header error on the index.php???
‘if’ statment redirect to index-j.php works fine except for one minor problem - it redirects to the japanese page even if the language is not at the top of selected languages.
To cap it all … i was almost happy it was working when the server refused to redirect: ‘redirects exceeded’. dont know how to set this…
Warning: Cannot modify header information - headers already sent by (output started at /home/exampletokyo/public_html/…
using the following did work for the index-j.php:
index-l
on January 25th, 2007 at 1:19 pm | #Link Comment