gple Posted November 15, 2010 Share Posted November 15, 2010 how do i redirect page within an if/else statement Quote Link to comment 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"); } Quote Link to comment 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. Quote Link to comment 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? Quote Link to comment 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 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.