Forum Moderators: coopster

Message Too Old, No Replies

PHP Redirect

without using header()

         

Francis

6:07 am on Jan 24, 2004 (gmt 0)

10+ Year Member



I've seen a lot of PHP redirect using headers. However, is there a way to redirect to another page without using header()?

I have already outputted an html and did a validation using PHP. So, how can I redirect after the HTML page has been sent, say after 30 seconds after they've read that the registration is successful? Much like the way the Refresh works after a successful posting in WebmasterWorld?

Xuefer

6:23 am on Jan 24, 2004 (gmt 0)

10+ Year Member



even using header()
redirect is client's behavior, not server side
server just tell client to redirect, do it or not just at client's own will

how server tell client?
1. header location..
2. meta refresh
3. java script..
all the aboves may not be supported by client

u may need using 2/3
<meta http-equiv="Refersh" content="30; URL=http://..." />
setTimeout("window.navigate('..');", 30000);

Francis

3:48 pm on Jan 27, 2004 (gmt 0)

10+ Year Member



Thanks for the help. I also saw ob_start(), this worked also. However, my question is: "Would this affect performance somehow, for example, loading time of the page, considering there are HTML codes as well?"