Please help,

Deprecated: Function session_is_registered() is deprecated in

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/renovati/public_html/sourcevibe.com/account/logout.php:5) in

<?php
session_start();

session_destroy(); 
if(!session_is_registered('id')){ 
$msg = "<big>You are now logged out<big>";
} else {
$msg = "<h2>could not log you out</h2>";
} 
?> 





<LINK REL="SHORTCUT ICON" HREF="http://www.sourcevibe.com/graphics/faveicon.gif">

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>

</td>
<LINK REL="SHORTCUT ICON" HREF="http://www.sourcevibe.com/graphics/faveicon.gif">

<title>Source Vibe</title><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><link rel="stylesheet" type="text/css" href="../default.css"><style>#bodydiv	{	height: 500px;	}</style></head><body>		<div id="container">	 	<div id="content">







			<div id="navbar">		<br><br><br><br><?php include 'menu/menu.php'; ?>
</div>		<div id="bodydiv">










<table style="width: 870px; height: 400px; text-align: left; margin-left: auto; margin-right: auto;" border="0" cellpadding="0" cellspacing="0">
 <tbody>
<tr>
      <td style="width: 120px; text-align: center; vertical-align: top;"></td>
<td style="text-align: center; vertical-align: top;">
<?php echo "$msg"; ?><br>
<br>
You are being redirected now.<br><table
 style="width: 100px; text-align: left; margin-left: auto; margin-right: auto;"
 border="0" cellpadding="0" cellspacing="0">
  <tbody>
    <tr>
      <td
 style="text-align: center; vertical-align: top;"></td>
    </tr>
  </tbody>
</table>

<br>
</td><td style="width: 120px; text-align: center; vertical-align: top;"></td>

</tr>
</tbody>
</table>















</div><div id="footer"></div><div id="underfooter"><p class="footer">

<img alt=""
 src="http://harborcitysolutions.com/sourcevibe.com/graphics/layout/line.png"><br>

<a style="color: #35A2EA;" href="/index.php"><small>HOME</small></a>|<a style="color: #35A2EA;" 
 href="/member_search.php"> <small>MEMBER SEARCH</small></a>
| <a style="color: #35A2EA;"  href="aboutus.php"><small>ABOUT US</small></a>
| <a style="color: #35A2EA;"  href="/contactus.php"><small>CONTACTUS</small></a>
|&nbsp; <a style="color: #35A2EA;" 
 href="/booking.php"><small>BOOKING</small></a><br>
<br>&copy 2013 Source Vibe. Project by <a style="color: #555; font-weight: normal !important;"  href="http://www.harborcitysolutions.com"><small>Harbor City Solutions.</small></a> All Rights Reserved.
<br>


<a style="color: #CC0000;" href="problemreport.php" target="_blank"><small><small>Report a Problem</small></a>




<table
 style="width: 950px; text-align: left; margin-left: auto; margin-right: auto;"
 border="0" cellpadding="0" cellspacing="0">
  <tbody>
    <tr>
      <td
 style="text-align: center; vertical-align: top;"><div style="position:relative; top: -640px; left:300px;"><?php echo $toplinks; ?></div></td>
    </tr>
  </tbody>
</table>


</p></div> </div></div></div></body></html>

    The "Function session_is_registered() is deprecated" warning means just that: the function is deprecated, so you should not use it as it may be removed in a future version of PHP, as in fact has been removed in PHP 5.4. The solution is to replace it with isset($_SESSION['id']).

    The "headers already sent" probably has to do with the previous warning, so fix that and this may well be fixed. If not, usually the approach is to check that you don't have whitespace at the top of your script and are not printing anything before the session has been established.

      Okay, So I have this now.. and I am getting Parse error: syntax error, unexpected T_ELSE in

      .

      <?php
      session_start();
      
      session_destroy(); 
      session_register('id');  
      $_SESSION['id'] = $id; { $msg = "<big>You are now logged out<big>"; } else { $msg = "<h2>could not log you out</h2>"; } ?>

        This is now what I have. I fixed but am still getting an error!

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

        <?php
        session_start(); // Must start session first thing
        session_destroy(); 
        if (!isset($_SESSION['id'])) { 
        $msg = "<big>You are now logged out<big>";
        } else {
        $msg = "<h2>could not log you out</h2>";
        } 
        ?> 

          Based on your next thread, I presume you have fixed this?

            Check that you don't have whitespace at the top of the file.

              I do not have a whitespace at the top of the file.

                Write a Reply...