Jump to content

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.
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]
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]
[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.
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.