4

I've got this error message:

Warning: Cannot modify header information - headers already sent by (output started at /Applications/MAMP/htdocs/---/dbconnect.php:1) in /Applications/MAMP/htdocs/---/functions.php on line 84

This is dbconnect.php:

<?php if(!defined("INC")){
  define("INC", 1);
}
error_reporting(E_ALL);
require_once("config.mysqli.php");
@$mysqli = mysqli_connect($dbhost,$dbuser,$dbpass,$dbname) or die("No Db found");?>

Also tried:

<?php ob_start(null);
if(!defined("INC")){
  define("INC", 1);
}
error_reporting(E_ALL);
require_once("config.mysqli.php");
@$mysqli = mysqli_connect($dbhost,$dbuser,$dbpass,$dbname) or die("No Db found");
ob_end_clean();?>

Please let me know if you need any more inormation. Thanks!

camelBase
  • 917
  • 1
  • 8
  • 16
  • 4
    What's `functions.php on line 84`? – Jessica Dec 19 '13 at 15:05
  • 3
    Looks like you might have the BOM error. http://stackoverflow.com/questions/5098454/session-start-error – Jessica Dec 19 '13 at 15:06
  • 4
    Note: You should really *stop* using the `@`. You need to handle your errors, not just ignore them. – gen_Eric Dec 19 '13 at 15:09
  • Thanks @RocketHazmat, this was not my code, never seen the @-prefix before. Here's what is does http://stackoverflow.com/questions/4653358/what-does-the-prefix-do-in-php. Agree that it's not a good idea to use it! – camelBase Dec 19 '13 at 15:26

1 Answers1

2

Looks like you might have the BOM error. See this post for more info: session_start() Error

Community
  • 1
  • 1
Jessica
  • 7,075
  • 28
  • 39