Solarpitch Posted January 9, 2007 Share Posted January 9, 2007 Hey guys, I am want to use the following code at the end of a page to send the user to the home page based on the result of an if/ esle. I keep getting the message, header already sent![code]if //true{header("Location: http://www.mysite.com/index.php");}esle{//something}[/code]Is there any way around this? Quote Link to comment Share on other sites More sharing options...
Jessica Posted January 9, 2007 Share Posted January 9, 2007 http://www.phpfreaks.com/forums/index.php/topic,37442.0.htmlHEADER ERRORS - READ HERE BEFORE POSTING THEM Quote Link to comment Share on other sites More sharing options...
magic2goodil Posted January 9, 2007 Share Posted January 9, 2007 if all else fails try this:[code]if //true{echo"<script>location.href='http://www.mysite.com/index.php';</script>";}else{//something}[/code] 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.