PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
Moderator: General Moderators
tores
Forum Contributor
Posts: 120 Joined: Fri Jun 18, 2004 3:04 am
Post
by tores » Tue Aug 23, 2005 5:47 am
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?
shiznatix
DevNet Master
Posts: 2745 Joined: Tue Dec 28, 2004 5:57 pm
Location: Tallinn, Estonia
Contact:
Post
by shiznatix » Tue Aug 23, 2005 5:51 am
a meta refresh is html a header is not.
Code: Select all
header('Location: http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF'].'"');
tores
Forum Contributor
Posts: 120 Joined: Fri Jun 18, 2004 3:04 am
Post
by tores » Tue Aug 23, 2005 6:14 am
Code: Select all
header('Refresh: 3;url=http://'.$_SERVER['HTTP_HOST'].$_SERVER['PHP_SELF']);
Redirects after 3 seconds.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Aug 23, 2005 7:25 am
tores wrote: Redirects after 3 seconds.
be warned, that's web server specific.
tores
Forum Contributor
Posts: 120 Joined: Fri Jun 18, 2004 3:04 am
Post
by tores » Tue Aug 23, 2005 8:27 am
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.
feyd
Neighborhood Spidermoddy
Posts: 31559 Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA
Post
by feyd » Tue Aug 23, 2005 9:55 am
your header() code, only certain servers support sending a "refresh" header.