shakeit Posted February 25, 2008 Share Posted February 25, 2008 Hello everyone, i am trying to redirect to another page.... I have a line that says... header("Refresh: 5; url=install.php"); Is it another way to redirect to another file with a pause, i.e. that will do the same as the header line above? Thank you all in advance once again and hope someone out there can helo me :.)) Quote Link to comment Share on other sites More sharing options...
Kingy Posted February 25, 2008 Share Posted February 25, 2008 indeed there is try meta refresh echo "<meta http-equiv='refresh' content='3;url=index.php' />"; change the 3 to the number of seconds you want and obviously change index.php to wherever you want to go Quote Link to comment Share on other sites More sharing options...
shakeit Posted February 25, 2008 Author Share Posted February 25, 2008 yeah but i am using this header after I push a button .. that is in an if() - loop .... Quote Link to comment Share on other sites More sharing options...
mainewoods Posted February 25, 2008 Share Posted February 25, 2008 the way you do a redirect in php is like this: header("location: $theurl"); Quote Link to comment Share on other sites More sharing options...
shakeit Posted February 25, 2008 Author Share Posted February 25, 2008 Okey, but is it wrong or not good to use the solution: echo "meta......" Like kingy above posted? Quote Link to comment Share on other sites More sharing options...
mainewoods Posted February 25, 2008 Share Posted February 25, 2008 it's better to do the header(). Meta refresh tags have some drawbacks: If the redirect happens quickly (less than 2-3 seconds), readers with older browsers can't hit the "Back" button. This is a usability problem. If the redirect happens quickly and goes to a non-existant page, your readers won't be able to hit the "Back" button. This is a usability problem that will cause people to completely leave your site. Search engine optimization problems Quote Link to comment 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.