Jump to content

[SOLVED] Cannot send session cache limiter - headers already sent


pznmynd

Recommended Posts

Little problem with my login script, when i go to implement it into my template i get this error when i run the page, Apparently there is already a session? I have no sessions open until then i cant see this being a problem.. The script works fine in testing stage no errors and nothing has changed from testing to implementing just now i get this error any ideas?

 

  Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /usr/home/web/users/a0028977/html/const/temp/subnews.php:9) in /usr/home/web/users/a0028977/html/const/temp/subnews.php on line 52 

 

Cut from Code, Line 52 is line 3 here.

 
require_once("connect.php"); //database connection

session_start();       <-- LINE 52!!

// catch feild data varabiles
$userid			=	$_POST['userid'];
$password       =   $_POST['password'];
$submitted		=	$_POST['submitted'];

if ($userid && $password){
////////////////////////////////////////////////
$query		= sprintf("SELECT  * FROM users where user_name = '$userid' and user_password = '$password'");
$result		= @mysql_query($query);
$rowAccount = @mysql_fetch_array($result);
///////////////////////////////////////////////
}
if ($rowAccount){

$_SESSION['id'] = $rowAccount['user_id'];

header("location: welcome.php");
exit;
}
elseif ($submitted){

echo "You dont exist.... Contact Admin";
}

?>

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.