Hi!
I have a little Problem:
I coded following to avoid that every person who visits my page is counted, but everytime I run that script the Parser tells me:
Cannot add header information- headers already sent by (output started at -:3) in on line 14 (where the cookie is set)
Heres the code of my Script:
<?php
echo "<h1>Setting Cookie for non-multiple IP logging </h1>";
if(isset($PageViewed))
{
echo"Cookie is active and so you are not counted <br><br>";
}else {
echo "The Cookie is not active and so you are counted <br><br>";
setcookie("PageViewed", "TRUE", time()+180);
$datei = fopen("count.txt","r") ;
$visit = fgets($datei,1024) ;
$visit = $visit + 1;
fclose($datei);
$datei = fopen("count.txt","w");
fwrite($datei, $visit) ;
fclose($datei);
}
?>
I would be very glad if someone could help me with my problem.
Thanks a lot
Ali