hi
can any1 help me with a prob of hit counter m strucked in between..
i need to write a php code for hit counter with the help of cookie...
where the counter should show only one visit per day from one IP
please help me out.
thanks...
Hit counter...
Moderator: General Moderators
- Grizzzzzzzzzz
- Forum Contributor
- Posts: 125
- Joined: Wed Sep 02, 2009 8:51 am
Re: Hit counter...
Code: Select all
<?php
if (isset($_COOKIE["example"]))
{
//if cookie already exists, do nothing
}
else
{
setcookie("example", "whatever", time()+86400);
//create a cookie lasting for a day
$hitcounter++;
//increment the hitcounter by 1
}
?>