Page 1 of 1

header() and meta http-equiv='refresh'

Posted: Tue Aug 23, 2005 5:47 am
by tores
Hi

I can't seem to get automatic redirection to work (using firefox 1.0.6)

Code:

Code: Select all

header('meta http-equiv="refresh" content="3;url=http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'"');
Why doens't this work? Isn't meta-headers supported by header?

Posted: Tue Aug 23, 2005 5:51 am
by shiznatix
a meta refresh is html a header is not.

Code: Select all

header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'"');

Posted: Tue Aug 23, 2005 6:14 am
by tores

Code: Select all

header('Refresh: 3;url=http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);
Redirects after 3 seconds.

Posted: Tue Aug 23, 2005 7:25 am
by feyd
tores wrote:Redirects after 3 seconds.
be warned, that's web server specific.

Posted: Tue Aug 23, 2005 8:27 am
by tores
be warned, that's web server specific.
Exactly what part is server specific? If you refer to the $_SERVER variables, then I got it covered.

Posted: Tue Aug 23, 2005 9:55 am
by feyd
your header() code, only certain servers support sending a "refresh" header.