bqheath Posted February 5, 2007 Share Posted February 5, 2007 I have a php script where I want to redirect people at the middle of the script. The problem is when I use the meta redirect it refreshes the page and shows the template jumbled for a split second before redirecting the user to the destination page. Is there anyway of redirecting so that it doesn't do this? Link to comment https://forums.phpfreaks.com/topic/37187-how-to-redirect-without-the-page-refreshing/ Share on other sites More sharing options...
Caesar Posted February 5, 2007 Share Posted February 5, 2007 <?php if($thisvar == 'something'; { header("Location: index.php"); } ?> Link to comment https://forums.phpfreaks.com/topic/37187-how-to-redirect-without-the-page-refreshing/#findComment-177651 Share on other sites More sharing options...
bqheath Posted February 5, 2007 Author Share Posted February 5, 2007 Thanks for the quick response but using header gives me the same problem. Is there any other way of redirecting that doesn't refresh the page for a split second? Link to comment https://forums.phpfreaks.com/topic/37187-how-to-redirect-without-the-page-refreshing/#findComment-177653 Share on other sites More sharing options...
ballhogjoni Posted February 5, 2007 Share Posted February 5, 2007 or just Code: <?php header("Location: index.php"); ?> but I personally like caesar's way better. Link to comment https://forums.phpfreaks.com/topic/37187-how-to-redirect-without-the-page-refreshing/#findComment-177654 Share on other sites More sharing options...
ballhogjoni Posted February 5, 2007 Share Posted February 5, 2007 it does it automatically, doesn't take a split second. Link to comment https://forums.phpfreaks.com/topic/37187-how-to-redirect-without-the-page-refreshing/#findComment-177655 Share on other sites More sharing options...
Azu Posted February 5, 2007 Share Posted February 5, 2007 Be sure to put a die(); after the redirect unless you want all the rest of the code to continue executing even after the person has been redirected to another page. Link to comment https://forums.phpfreaks.com/topic/37187-how-to-redirect-without-the-page-refreshing/#findComment-177719 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.