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? Quote Link to comment 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"); } ?> Quote Link to comment 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? Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment 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. 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.