Jump to content

can anyone help me with this error :Warning: session_start() [function.session-start]:


Recommended Posts

here 's the full error message :
[b]Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at C:\Program Files\xampp\htdocs\bpo\classes\clsMetaContent.php:45) in C:\Program Files\xampp\htdocs\bpo\includes\session.php on line 2

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at C:\Program Files\xampp\htdocs\bpo\classes\clsMetaContent.php:45) in C:\Program Files\xampp\htdocs\bpo\includes\session.php on line 2

Warning: Cannot modify header information - headers already sent by (output started at C:\Program Files\xampp\htdocs\bpo\classes\clsMetaContent.php:45) in C:\Program Files\xampp\htdocs\bpo\includes\session.php on line 4[/b]


and here 's my session.php script

<?php
[b]here's line -- > 2[/b] session_start();
session_name( 'MyPHPSite' );
[b]here's line 4 -->[/b]header( "Cache-conrol : private"); // Fix for IE
function login_check(){
if($_SESSION['login'] != TRUE ){
myheader("Login Required!");
include $_SERVER['DOCUMENT_ROOT'].
'/bpo/html/forms/login_form.html';

footer();
exit();
}
}
function admin_check(){
if($_SESSION['admin_access']){
myheader("Access Denied!");
echo "<center>This Area is Restricte,For Website Administrators!";
footer();

exit();
}
}
?>

i have been trying to found the problem but i can't so guys help me thx

It is essential that nothing is outputted to the browser before session_start, so NO linebreaks and NO whitespace before session_start - and the php start tag absolute top-left corner

__________________
<?
session_start();

--------------------------
[!--quoteo(post=361097:date=Apr 2 2006, 11:44 PM:name=alpine)--][div class=\'quotetop\']QUOTE(alpine @ Apr 2 2006, 11:44 PM) [snapback]361097[/snapback][/div][div class=\'quotemain\'][!--quotec--]
It is essential that nothing is outputted to the browser before session_start, so NO linebreaks and NO whitespace before session_start - and the php start tag absolute top-left corner

__________________
<?
session_start();

--------------------------
[/quote]


thx , so what should i remove from my script , i mean session.php
[!--quoteo(post=361108:date=Apr 3 2006, 12:29 AM:name=footballkid4)--][div class=\'quotetop\']QUOTE(footballkid4 @ Apr 3 2006, 12:29 AM) [snapback]361108[/snapback][/div][div class=\'quotemain\'][!--quotec--]
If session.php is a child script (i.e. it is called via require() or include()) make sure the parent script has no output before session.php is executed.
[/quote]

thx you all guys , because of your reply i found where i made the the mistake

instead of this on top of my script :[b] include $_SERVER['DOCUMENT_ROOT'].'/bpo/includes/session.php';
include $_SERVER['DOCUME NT_ROOT'].'/bpo/layout.php';
[/b]
i had this instead :
i[b]nclude $_SERVER['DOCUMENT_ROOT'].'/bpo/layout.php';
include $_SERVER['DOCUMENT_ROOT'].'/bpo/includes/session.php';[/b]


but guys now the logo doesn't show on top of the page , why is that , please help again guys thx .....

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.