Hi All
I am getting an warning on my web page when I uploaded the page on server I just writing a PHP PAge Hit Counter-
Warning: session_start() [function.session-start]: Cannot send session cookie - headers already sent by (output started at /home/cbsecpsn/public_html/csnip/form_453570.php:7) in /home/cbsecpsn/public_html/csnip/counter.php on line 2
Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at /home/cbsecpsn/public_html/csnip/form_453570.php:7) in /home/cbsecpsn/public_html/csnip/counter.php on line 2
And this is the output Total page views = 1
Here is the Code -
Counter.php
<?PHP
session_start();
if(isset($_SESSION['views'])){
$_SESSION['views'] = $_SESSION['views']+ 1;
}else{
$_SESSION['views'] = 1;
}
echo "Total page views = ". $_SESSION['views'];
?>
And I used it like this in Survey_Form.php
<div class='sfm_cr_box' style='padding:3px; width:350px'>
<?php
echo "<hr><div align=\"center\">";
include_once "counter.php"; // this will include the counter.
echo "</div>";
?>
</div>
What is the problem with the code