thefollower Posted August 19, 2007 Share Posted August 19, 2007 Can an include have a redirect? Basically my if statement in my include has "if fail redirect to fail.php" but its not working. when the the fail occurs my code wont redirect me to a different page. Quote Link to comment https://forums.phpfreaks.com/topic/65739-include-with-a-redirect/ Share on other sites More sharing options...
m1a2x3x7 Posted August 19, 2007 Share Posted August 19, 2007 please post your code Quote Link to comment https://forums.phpfreaks.com/topic/65739-include-with-a-redirect/#findComment-328381 Share on other sites More sharing options...
trq Posted August 19, 2007 Share Posted August 19, 2007 Can an include have a redirect? Indeed it can. Remember however, that you cannot call the header function once any output has been sent to the browser. Quote Link to comment https://forums.phpfreaks.com/topic/65739-include-with-a-redirect/#findComment-328383 Share on other sites More sharing options...
MadTechie Posted August 19, 2007 Share Posted August 19, 2007 check here for reasons why its probably failing Quote Link to comment https://forums.phpfreaks.com/topic/65739-include-with-a-redirect/#findComment-328389 Share on other sites More sharing options...
keeB Posted August 20, 2007 Share Posted August 20, 2007 <?php if($fail) { header("Location: http://google.com"); //or include("redirect_to_google.php"); } // continue processing $a = $b + $c; ?> Quote Link to comment https://forums.phpfreaks.com/topic/65739-include-with-a-redirect/#findComment-328403 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.