Jump to content


Photo

session_start() [function.session-start]: Cannot send cache limiter - headers...


  • Please log in to reply
4 replies to this topic

#1 cameeob2003

cameeob2003
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 04 July 2006 - 11:54 PM

I am getting the following errors:

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /homepages/34/d154144477/htdocs/ventgaming/n2p/login.php:22) in /homepages/34/d154144477/htdocs/ventgaming/n2p/index2.php on line 224


I was wondering what this error is caused from. I read on a dif forum that it can be from spaces outside of code but I have none and still recieve this error.

#2 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 04 July 2006 - 11:57 PM

Are you outputing anything to the browser before calling sesstion_start()?

#3 cameeob2003

cameeob2003
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 04 July 2006 - 11:59 PM

no i am not calling anything before it.

it is just:

<html><body>
<div style="position: absolute; top: 191px; left: 260px;">
<?php
session_start();
if(!$_SESSION['user']){
	echo "<font id=UserPanelText />You are not logged in.<br/><br/>";
}else{
	echo "You are logged in as:". $_SESSION['username'] ."<br/><br/>";
	}
	$newpms = $_SESSION['priv_messages'];
	if($newpms > "0"){
		echo "<a href=?page=newpmessage=$id>Unread Messages</a> (". $newpms .")<br/>";
	}else{
		echo "<font id=UserPanelText /><a href=?page=pmessages=$id>Mailbox</a><br/><font id=UserPanelText /><a href=?page=user_panel>User Panel</a><br/>";
	} 
?>
</div>
</body>
</html>


#4 cameeob2003

cameeob2003
  • Members
  • PipPipPip
  • Advanced Member
  • 79 posts

Posted 05 July 2006 - 12:14 AM

here is my login.php

<?php
$user = $_POST['username'];
$pass = $_POST['password'];

$user=str_replace(" ","",$user);//remove spaces from username
$pass=str_replace(" ","",$pass);//remove spaces from password
$user=str_replace("%20","",$user);//remove escaped spaces from username
$pass=str_replace("%20","",$pass);//remove escaped spaces from password
$user=addslashes($user);//remove spaces from username
$pass=addslashes($pass);//remove spaces from password

// connect to mysql db
$conn = mysql_connect("db411.perfora.net","dbo168663394","w.N6n7gG");
mysql_select_db("db168663394");

$request = "SELECT * FROM users WHERE password='".$pass."' AND username='".$user."'";
$results = mysql_query($request,$conn);

if(mysql_num_rows($results))//function returns true if any matches are found
{
	echo "User Logged in.";
	$_SESSION['user'] = $user;
	$_SESSION['auth'] = true;
	include("index2.php");
}
else
{
	echo "User Name/Password Not Found.";
	$_SESSION['auth'] = false;
	include("index.php");
}

?>


#5 trq

trq
  • Staff Alumni
  • Advanced Member
  • 31,041 posts

Posted 05 July 2006 - 12:20 AM

i am not calling anything before it

Whats this then?
<html><body>
<div style="position: absolute; top: 191px; left: 260px;">
scotch mist?

Read this sticky.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users