» Quick Links
You can make money on these forums
We Share profits with you
Google
Google Adsense
Google Adwords
YPN
Yahoo
MSN Search
Web Directories
Web Hosting
Web Hosting Offers
Hosting News
Suggestions
Link Building
Domain Names
PHP Forums
MySQL Forums
» More Links
OSP News
Reseller Hosting
Shared Hosting
Dedicated Servers
Google Adsense
Search Engine Marketing
Link Development
Affiliate Marketing


» Advertising
Multiple DC PR Check

Free SEO Tools


Go Back   Webmaster Forums > Website Developement / Programming > PHP Programming and Tips

PHP Programming and Tips Discuss about PHP programming and Share Tips. Ask questions about Scripting and Errors.

Reply
 
Thread Tools Display Modes
  #1  
Old 12-09-2005, 06:10 AM
omen omen is offline
Junior Member
 
Join Date: Dec 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Rep Power: 0
omen is on a distinguished road
Default To define click as visit?

I have code for tracking time of visitor. I have the fillowing function:

PHP Code:
function olduser($visitID)
{
$now = time();
$visitData = getVisit($visitID);
if ( ! $visitData )
{ return newuser();}
$visitData ['totalClicks']++;
if ( ($visitData ['lastVisit'] + $GLOBALS ['slength']) > $now)
{
$visitData ['totalDuration'] += ($now - $visitData ['lastVisit']);
}
else
{
$visitData ['numVisits']++;
}

$visitData ['lastVisit']=$now;
updateVisit ($visitData);
-- 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
Revenue Sharing Ads ( ?):
  #2  
Old 12-09-2005, 06: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
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adsense Click thru is more in August pumice AdSense 4 08-22-2006 10:21 AM
How much you will spend per click? khasmoth Google AdWords Education 1 08-16-2006 08:41 AM
Do you click on ads? stone Google 6 08-15-2006 05:38 PM
AIT Says Click Fraud Drawing Congressional Attention outsourcingplans Web Hosting Industry 0 05-10-2006 08:35 PM
Click to Call from Google joney Google 1 11-26-2005 10:28 AM


All times are GMT. The time now is 03:13 AM.