Possible Duplicate:
Headers already sent by PHP
I am new in object-oriented php. I have some problem that i can't solve. My problem is that when I want to log in/out then some error messages come out as shown below :: [note that it works well in functional php but problem is in oop php]
Error ::
Warning: Cannot modify header information - headers already sent by (output
started at E:\XAMPP\xampp\htdocs\photo_gallery_new\Includes\database_object.php:6)
in E:\XAMPP\xampp\htdocs\photo_gallery_new\Includes\Functions.php on line 14
My code ::
index.php
<?php require_once ("../../Includes/initiate.php"); ?> 
 <?php
if( !$session->is_logged_in() ) {
    redirect_to("login.php");
}
?> 
login.php
<?php   
require_once ("../../Includes/initiate.php");
if( $session->is_logged_in() ) {
    redirect_to("index.php");
}   
// Remember to give your form's submit tag a name="submit" attribute! 
if( isset($_POST['submit']) ) {  // form has been submitted
    $username = trim($_POST['username']); $password = trim($_POST['password']);     
    // Check database to see if username/password exist     
    $found_user = USER::authenticate($username, $password);     
    if($found_user) {
        $session->login($found_user);
        redirect_to("index.php");
    }  else {
        // username/password combo was not found in the database
        $message = "Username/password combination incorrect.";
    }
}   
else {   // form has not been submitted
    $username = "";
    $password = "";
}
?>
<html> 
     <----  form design [ form action = 'login.php' ] --->
</html>
initiate.php
  <?php
      require_once ("session.php");
       require_once ("Config.php");
       require_once ("Functions.php");
      require_once ("Database.php");
     require_once ("database_object.php");  // this makes error
   require_once ("user.php");
  ?>
function.php
<?php       
function strip_zeros_from_date( $marked_string="") {  .....   } 
function redirect_to( $location = NULL) {   // check loged in/not
    if($location != NULL) {
        header("Location: {$location}");  
        exit;
    }
}
function output_message($message = "") { ....   } 
function __autoload($class_name) {  ......   }
function include_layout_template( $template = "" ) { ...  }
 ?>
initiate.php
 <?php
require_once ("database.php");  
class databaseObject {      
}   
$newClass = new databaseObject();   
 ?>
 
     
    