Web Hosting Talk







View Full Version : probleme : header sent


unknownman
08-17-2005, 02:23 AM
i do a project and user session for admin page
i write a class for manage admin page
all admin page have a same code for starting( to authenticateing)
but one of theme send and error when load it and say the "header sent before .."

<?php
session_start();
require_once "../class/db.php";
require_once "../class/config.php";
require_once "../class/template.inc.php";
require_once "../class/Admin/session.inc.php";
require_once "../class/Admin/cookie.inc.php";
require_once "../class/Admin/security.inc.php";
require_once "../class/Admin/add.user.inc.php";
require_once "../class/Admin/edit.user.inc.php";
require_once "../class/Admin/privillege.inc.php";
require_once "../class/Admin/remove.user.inc.php";
require_once "../class/Admin/view.user.inc.php";
require_once "privillege.php";

#Security Check
$protect = new Security();
$security_check = $protect->Login( @$_POST['username'] , @$_POST['password'] , @$_POST['remember']=='remember' ? true : false );
if ( !$security_check )
{
include "./err/login_error.htm";
die();
}


it said that header sent from line 1 but how can it possible
this line work in all of other file

maxymizer
08-17-2005, 02:47 AM
Do you have any whitespace before <?php?
You cannot have any whitespace (regular space, tab, newline) before issuing session_start(); (unless you implement output buffering mechanisms).

unknownman
08-17-2005, 04:41 AM
offcource i know that dont must exit any thing yet white space before it
no white space exist
no data exit before session start
this script work in my localhost in home but dont work in server
what can possible

nnormal
08-17-2005, 10:24 AM
you can try

ob_start();

sometimes whitespace creeps in as a result of textformatting issues between win32/UNIX/mac