Page 1 of 1

redirect

Posted: Thu Nov 09, 2006 2:58 pm
by murlopaz
Is there a way to redirect the user to another page by using PHP?
I know there are two alternatives include and header. But what if I have to call the redirect from the middle of the page, when the header was already sent.
I've heard about redirecting with meta tags, but it seems there is a bug in FireFox related to metatags.

Posted: Thu Nov 09, 2006 3:01 pm
by feyd
  1. engineer the page's code such that all the logic is processed prior to any output
  2. drop some Javascript or other client side language that does the redirection inline (if you're in the page code)
  3. do a meta redirect if you're in the html headers still
The preference is toward "a."

Posted: Thu Nov 09, 2006 3:05 pm
by murlopaz
the problem is that meta redirect doesn't always work with firefox...
that's the problem i have now, and I am trying to fix that wihtout making radical changes to the script

Posted: Thu Nov 09, 2006 3:07 pm
by feyd
I have yet to have a problem with Firefox and meta-redirection as long as they are in the correct location: the page headers.

Posted: Thu Nov 09, 2006 3:12 pm
by RobertGonzalez
Why can you not perform a header() redirect before output?