Reply
Modifiying Statistics
Old 03-19-2006, 05:11 AM Modifiying Statistics
dannyisonfire's Avatar
Average Talker

Posts: 22
Location: Hartlepool
I have the following code,

PHP Code:
<body>
<font face="Verdana" size="1">
<?php
// Our log file;
$counter "stats.txt";
// Date logging;
$today getdate();
$month $today[month];
$mday $today[mday];
$year $today[year];
$current_date $mday $month $year;

// Log visit;
$fp fopen($counter"a");
$line $REMOTE_ADDR "|" $mday $month $year "\n";
$size strlen($line);
fputs($fp$line$size);
fclose($fp);
// Read log file into array;
$contents file($counter);
// Total hits;
$total_hits sizeof($contents);
// Total hosts;
$total_hosts = array();
for (
$i=0;$i<sizeof($contents);$i++) {
 
$entry explode("|"$contents[$i]);
 
array_push($total_hosts$entry[0]);
}
$total_hosts_size sizeof(array_unique($total_hosts));
// Daily hits;
$daily_hits = array();
for (
$i=0;$i<sizeof($contents);$i++) {
 
$entry explode("|"$contents[$i]);
 if (
$current_date == chop($entry[1])) {
  
array_push($daily_hits$entry[0]);
 }
}
$daily_hits_size sizeof($daily_hits);
// Daily hosts;
$daily_hosts = array();
for (
$i=0;$i<sizeof($contents);$i++) {
 
$entry explode("|"$contents[$i]);
 if (
$current_date == chop($entry[1])) {
  
array_push($daily_hosts$entry[0]);
 }
}
$daily_hosts_size sizeof(array_unique($daily_hosts));
?>
<? 
echo "
Total Hits:<b> " 
$total_hits "</b><br><br>
Total Unique Hits: <b> " 
$total_hosts_size "</b><br><br>
Todays Hits: <b> " 
$daily_hits_size "</b><br><br>
Todays unique Hits: <b>" 
$daily_hosts_size
?>
and it shows my stats check it out here - http://www.dannyisonfire.com/test.php)
However, i want to edit the stats to make up for all the hits it missed.
Is there a way to add a certain number to all of the categories.
Thanks.
__________________
www.dannyisonfire.com

Last edited by 0beron : 03-19-2006 at 07:54 AM.
dannyisonfire is offline
Reply With Quote
View Public Profile Visit dannyisonfire's homepage!
 
When You Register, These Ads Go Away!
     
Old 03-19-2006, 08:03 AM Re: Modifiying Statistics
metho's Avatar
Ultra Talker

Posts: 345
Just let it roll another month. You'll get accurate stats next month without having to do a thing.
metho is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Modifiying Statistics
 

Thread Tools

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12944 seconds with 13 queries