Jump to content


Photo

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


  • Please log in to reply
4 replies to this topic

#1 the apprentice webmaster

the apprentice webmaster
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 03 April 2006 - 04:17 AM

here 's the full error message :
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



and here 's my session.php script

<?php
here's line -- > 2 session_start();
session_name( 'MyPHPSite' );
here's line 4 -->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



#2 alpine

alpine
  • Members
  • PipPipPip
  • Advanced Member
  • 756 posts
  • LocationNorway

Posted 03 April 2006 - 04:44 AM

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();

--------------------------

#3 the apprentice webmaster

the apprentice webmaster
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 03 April 2006 - 04:46 AM

[!--quoteo(post=361097:date=Apr 2 2006, 11:44 PM:name=alpine)--][div class=\'quotetop\']QUOTE(alpine @ Apr 2 2006, 11:44 PM) View Post[/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

#4 Guest_footballkid4_*

Guest_footballkid4_*
  • Guests

Posted 03 April 2006 - 05:29 AM

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.

#5 the apprentice webmaster

the apprentice webmaster
  • Members
  • PipPipPip
  • Advanced Member
  • 65 posts

Posted 03 April 2006 - 05:39 AM

[!--quoteo(post=361108:date=Apr 3 2006, 12:29 AM:name=footballkid4)--][div class=\'quotetop\']QUOTE(footballkid4 @ Apr 3 2006, 12:29 AM) View Post[/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 : include $_SERVER['DOCUMENT_ROOT'].'/bpo/includes/session.php';
include $_SERVER['DOCUME NT_ROOT'].'/bpo/layout.php';

i had this instead :
include $_SERVER['DOCUMENT_ROOT'].'/bpo/layout.php';
include $_SERVER['DOCUMENT_ROOT'].'/bpo/includes/session.php';



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




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users