i used session in my admin panel so when i click on log out button in server i faced with this msgs

Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/royalfa/public_html/admin/logout.php:2) in /home/royalfa/public_html/admin/logout.php on line 5

Warning: Cannot modify header information - headers already sent by (output started at /home/royalfa/public_html/admin/logout.php:2) in /home/royalfa/public_html/admin/logout.php on line 7


and here it is my php commands :


<title>Logout</title>
<?php
//error_reporting(0);
ob_start();
session_start();
unset($_SESSION);
session_destroy();
header("location:index.php");
ob_end_flush();
?>


any body help me ?????

Recommended Answers

All 2 Replies

Remove everything before <?php . You will not see the title anyway, because the page is redirected.

Thanks my friend

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.