jakebur01 Posted April 7, 2009 Share Posted April 7, 2009 What is the best way to redirect to a new page after the page has fully loaded? Would this require javascript. I realize I header redirect must be put before all other code, but I need it at the bottom of the script. - Jake Quote Link to comment https://forums.phpfreaks.com/topic/153073-solved-a-sure-fire-way-to-redirect/ Share on other sites More sharing options...
Maq Posted April 7, 2009 Share Posted April 7, 2009 An HTML redirect or JS redirect should work. Quote Link to comment https://forums.phpfreaks.com/topic/153073-solved-a-sure-fire-way-to-redirect/#findComment-803985 Share on other sites More sharing options...
deadonarrival Posted April 7, 2009 Share Posted April 7, 2009 Either Javascript, or a meta tag with a redirect after x seconds would do the job too. The advantage being that you don't need javascriptThe downside being that you can only redirect after a set number of seconds; rather than on a user action and that it's x seconds after the meta loads, rather than the page completion. Quote Link to comment https://forums.phpfreaks.com/topic/153073-solved-a-sure-fire-way-to-redirect/#findComment-803988 Share on other sites More sharing options...
jakebur01 Posted April 7, 2009 Author Share Posted April 7, 2009 So are you saying that even though the html redirect is at the bottom of the pup page that it could actually execute before the page finishes loading? Quote Link to comment https://forums.phpfreaks.com/topic/153073-solved-a-sure-fire-way-to-redirect/#findComment-804018 Share on other sites More sharing options...
Maq Posted April 7, 2009 Share Posted April 7, 2009 I don't think it will redirect before the PHP, cause it's interpreted and then served as HTML. Try it out. Quote Link to comment https://forums.phpfreaks.com/topic/153073-solved-a-sure-fire-way-to-redirect/#findComment-804019 Share on other sites More sharing options...
killah Posted April 7, 2009 Share Posted April 7, 2009 header('Refresh: 3; url=urlhere'); Will refresh the page in 3 second's to the url parameter. Quote Link to comment https://forums.phpfreaks.com/topic/153073-solved-a-sure-fire-way-to-redirect/#findComment-804022 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.