Here is the whole code to track visitor:
PHP Code:
<?
$db = "data/testdb";
$dbres = sqlite_open ($db, 0666,$error);
if (!is_int ($field))
if (!is_resource ($dbres))
{
die ("sqlite error:$error");
}
$GLOBALS['slength']= 300;
$GLOBALS['dbres'] = connect ("data/testdb");
$GLOBALS['visitID']= $_COOKIE['cookname'];
$GLOBALS['userStats'];
if (empty($visitID) )
{
$userStats=newuser();
print "Welcome, first time user!";
}
else
{
print "Welcome back, $visitID!";
$userStats=olduser($visitID);
}
function newuser()
{
$visitData = array
(
'FirstVisit'=>time(),
'LastVisit'=>time(),
-- This message may have been cut off and the rest will only be shown to members. To become a member, click here --