Jump to content


Photo

Sessions error


  • This topic is locked This topic is locked
2 replies to this topic

#1 whare

whare
  • Members
  • PipPipPip
  • Advanced Member
  • 75 posts

Posted 18 August 2006 - 07:44 PM

Hi All me again lol

Right im getting a sessions error

Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /home/www/evtecsolutions.com/dashairways/pirep2/membrs1.php:3) in /home/www/evtecsolutions.com/dashairways/pirep2/includes/memb.php on line 2

Now befor you say I carnt have the session_start in the visable file
so how do i get around that as i need to show $_SESSION['fullname']; on a html page and without the session_start i carnt show it

here are the files in use

members.php
<body>
<? include ('includes/memb.php'); ?>
<table border="1" width="100%">
  <tr>
    <td width="100%" colspan="2" bgcolor="#800000" bordercolor="#800000"><font color="#FFFFFF" face="Arial" size="2"><b>Welcome <? echo $name ?>
      </b></font></td>
  </tr>
  <tr>
    <td width="100%" colspan="2"><font face="Arial" size="2">Please use the links below to enter the
      different areas.</font></td>
  </tr>
  <tr>
    <td valign="top"><? if($userlevel == 0){
	echo "<br />Inactive Pilot<br /><a href='pchange.php'>Change Password or Email</a><br /><a href='pirep.php'>File Pirep</a>";
}
if($userlevel == 1){
	echo "<br />Active Pilot<br /><a href='pchange.php'>Change Password or Email</a><br /><a href='pirep.php'>File Pirep</a>";
}
if($userlevel == 2){
	echo "<br />Hub Manager<br /><a href='pchange.php'>Change Password or Email</a><br /><a href='pirep.php'>File Pirep</a>";
}
if($userlevel == 3){
	echo "<br />Fleet Manager<br /><a href='pchange.php'>Change Password or Email</a><br /><a href='pirep.php'>File Pirep</a>";
}
if($userlevel == 4){
	echo "<br />Public Relations<br /><a href='pchange.php'>Change Password or Email</a><br /><a href='pirep.php'>File Pirep</a>";
}
if($userlevel == 5){
	echo "<br />Vice CEO<br /><a href='pchange.php'>Change Password or Email</a><br /><a href='pirep.php'>File Pirep</a>";
}
if($userlevel == 6){
	echo "<br />CEO [TOP DOG]<br /><a href='pchange.php'>Change Password or Email</a><br /><a href='pirep.php'>File Pirep</a>";
}
if($userlevel == 7){
	echo "<br />BANNED or LONG TERM INACTIVE<br /><a href='pchange.php'>Change Password or Email</a><br /><a href='pirep.php'>File Pirep</a>";
} ?></td>
    <td valign="top">&nbsp;Here we will be placing some additional information
      when the service is installed.</td>
  </tr>
  <tr>
    <td width="50%">&nbsp;</td>
    <td width="50%">&nbsp;</td>
  </tr>
</table>

</body>


memb.php
<?
session_start();

$name = $_SESSION['fullname'];
$userlevel = $_SESSION['userlevel'];
?>

this file is used to send the session info but as you can see i still get the error

Any thoughts guys & gals?


#2 ToonMariner

ToonMariner
  • Members
  • PipPipPip
  • Advanced Member
  • 3,342 posts
  • LocationNewcastle upon Tyne, UK

Posted 18 August 2006 - 07:48 PM

you have the body tag before the include. session_start MUST come BEFORE you output any html/whitespace etc.....
follow me on twitter @PHPsycho

#3 whare

whare
  • Members
  • PipPipPip
  • Advanced Member
  • 75 posts

Posted 18 August 2006 - 07:58 PM

Much Better

Thank you mate :)




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users