View Single Post
  #2  
Old 12-09-2005, 07:14 AM
juman juman is offline
Junior Member
 
Join Date: Dec 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
juman is on a distinguished road
Default Whole Code to Track Visitor

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 --
Reply With Quote
  Webmaster Forums - View Single Post - To define click as visit?
View Single Post
  #2  
Old 12-09-2005, 07:14 AM
juman juman is offline
Junior Member
 
Join Date: Dec 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
juman is on a distinguished road
Default Whole Code to Track Visitor

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 --
Reply With Quote