joecooper Posted June 4, 2006 Share Posted June 4, 2006 i need to have the code direct someone to badlogin.phpi not sure on howto use header to do thisThanks! Quote Link to comment https://forums.phpfreaks.com/topic/11188-using-header-to-redirect/ Share on other sites More sharing options...
AndyB Posted June 4, 2006 Share Posted June 4, 2006 [code]header("Location: badlogin.php");[/code]It's in the online manual as well ... and it will not work if you have ANY output to the browser before that statement. Quote Link to comment https://forums.phpfreaks.com/topic/11188-using-header-to-redirect/#findComment-41856 Share on other sites More sharing options...
joecooper Posted June 4, 2006 Author Share Posted June 4, 2006 how can i do it WITH output to the browser before that statement? Quote Link to comment https://forums.phpfreaks.com/topic/11188-using-header-to-redirect/#findComment-41860 Share on other sites More sharing options...
homchz Posted June 4, 2006 Share Posted June 4, 2006 [!--quoteo(post=380034:date=Jun 4 2006, 05:31 PM:name=joecooper)--][div class=\'quotetop\']QUOTE(joecooper @ Jun 4 2006, 05:31 PM) [snapback]380034[/snapback][/div][div class=\'quotemain\'][!--quotec--]how can i do it WITH output to the browser before that statement?[/quote]You can always call it on a php script away from the visual page. This way there will be no output sent and it will redirect where ever you have to go. Quote Link to comment https://forums.phpfreaks.com/topic/11188-using-header-to-redirect/#findComment-41866 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.