Jump to content

Headers


padams

Recommended Posts

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.