padams Posted November 6, 2008 Share Posted November 6, 2008 Having a small problem with the headers command. I thought this would work okay, but I get the error: Warning: Cannot modify header information - headers already sent by (output started at /home/leotajs/public_html/createopponent.php:6). The dbconnect includes file just has the database connection stuff. ob_start(); include("includes/dbconnect.php"); session_start(); ob_flush(); if(isset($_SESSION['admin'])) { $teams_sql = "SELECT * FROM teams"; $teams_query = mysql_query($teams_sql) or die(mysql_error()); $rsTeams = mysql_fetch_assoc($teams_query); $galleries = "SELECT * FROM gallery"; $galleries_query = mysql_query($galleries) or die(mysql_error()); $rsGalleries = mysql_fetch_assoc($galleries_query); } else { header("Location: admin.php");} Link to comment https://forums.phpfreaks.com/topic/131601-headers/ Share on other sites More sharing options...
ratcateme Posted November 6, 2008 Share Posted November 6, 2008 well line 6 of createopponent.php is creating output what is the ob_flush(); for? Scott. Link to comment https://forums.phpfreaks.com/topic/131601-headers/#findComment-683495 Share on other sites More sharing options...
padams Posted November 6, 2008 Author Share Posted November 6, 2008 Not sure about the ob_flush stuff. I needed it in an old site and have been reusing a bit of code. Once removed it worked fine. Thanks. Link to comment https://forums.phpfreaks.com/topic/131601-headers/#findComment-683505 Share on other sites More sharing options...
ratcateme Posted November 6, 2008 Share Posted November 6, 2008 try removing it and see if it works Scott. Link to comment https://forums.phpfreaks.com/topic/131601-headers/#findComment-683506 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.