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 :.)) Link to comment https://forums.phpfreaks.com/topic/92811-refirect/ 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 Link to comment https://forums.phpfreaks.com/topic/92811-refirect/#findComment-475460 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 .... Link to comment https://forums.phpfreaks.com/topic/92811-refirect/#findComment-475461 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"); Link to comment https://forums.phpfreaks.com/topic/92811-refirect/#findComment-475480 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? Link to comment https://forums.phpfreaks.com/topic/92811-refirect/#findComment-475691 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 Link to comment https://forums.phpfreaks.com/topic/92811-refirect/#findComment-475964 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.