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? Link to comment https://forums.phpfreaks.com/topic/33494-problem-with-headerlocation-httpwwwmysitecomindexphp/ 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 Link to comment https://forums.phpfreaks.com/topic/33494-problem-with-headerlocation-httpwwwmysitecomindexphp/#findComment-156753 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] Link to comment https://forums.phpfreaks.com/topic/33494-problem-with-headerlocation-httpwwwmysitecomindexphp/#findComment-156757 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.