I have a "visitor counter" code:
It was okay on WAMP, but online I'm getting "headers already sent" warning, so I must modify that cookie so it works. Warning says about line 7.PHP Code:<?php
$fn = 'index_files/licznik.txt';
$counter = (file_exists($fn) ? (int)file_get_contents($fn) : 0) + 1;
$cookiename = 'licznik';
if ( ! isset($_COOKIE[$cookiename])){
file_put_contents($fn, $counter);
setcookie($cookiename, '1', time()+60*60*24);
}
?>



Reply With Quote

Bookmarks