Jump to content

Archived

This topic is now archived and is closed to further replies.

cameeob2003

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

Recommended Posts

I am getting the following errors:

[quote]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[/quote]

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.

Share this post


Link to post
Share on other sites
Are you outputing anything to the browser before calling sesstion_start()?

Share this post


Link to post
Share on other sites
no i am not calling anything before it.

it is just:

[code]<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>[/code]

Share this post


Link to post
Share on other sites
here is my login.php

[code]<?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");
}

?>[/code]

Share this post


Link to post
Share on other sites
[quote]i am not calling anything before it[/quote]
Whats this then?
[code]
<html><body>
<div style="position: absolute; top: 191px; left: 260px;">
[/code]
scotch mist?

Read [url=http://www.phpfreaks.com/forums/index.php/topic,37442.0.html]this[/url] sticky.

Share this post


Link to post
Share on other sites

×

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.