gple Posted November 15, 2010 Share Posted November 15, 2010 how do i redirect page within an if/else statement Link to comment https://forums.phpfreaks.com/topic/218692-redirect/ Share on other sites More sharing options...
TrueColors Posted November 15, 2010 Share Posted November 15, 2010 if(statement) { header("Location: file.php"); } else { header("Location: file2.php"); } Link to comment https://forums.phpfreaks.com/topic/218692-redirect/#findComment-1134275 Share on other sites More sharing options...
gple Posted November 15, 2010 Author Share Posted November 15, 2010 sorry, i have an echo statement before that. Link to comment https://forums.phpfreaks.com/topic/218692-redirect/#findComment-1134277 Share on other sites More sharing options...
TrueColors Posted November 15, 2010 Share Posted November 15, 2010 Can you provide any code, and more information in what you are trying to do? Link to comment https://forums.phpfreaks.com/topic/218692-redirect/#findComment-1134278 Share on other sites More sharing options...
chintansshah Posted November 15, 2010 Share Posted November 15, 2010 use output buffering function to avoid such situation. For your reference http://php.net/manual/en/function.ob-start.php Link to comment https://forums.phpfreaks.com/topic/218692-redirect/#findComment-1134298 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.