It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Board index Programming PHP and MySQL Forum

Little problem...

Moderator: Malcolm

Little problem...

Postby Tomi on Fri Jun 30, 2006 3:29 pm

As you can see here, http://www.gamewarfarecentre.com i have webstatistics on the left hand side. There is :

- Page hits:

- Unique hits:

- Todays Page hits:

- Todays unique hits:

The problem area is the red stats, the unique hits and todays unique hits do not function properly, it will only say "1" no matter how many people vist my site. (i have tested this)

Your forum wont let me post the code that is on my server, it says error 104 i think, so i posted it on my forum : http://z7.invisionfree.com/GWC/index.ph ... try3391213
Last edited by Tomi on Fri Jun 30, 2006 3:38 pm, edited 3 times in total.
User avatar
Tomi
500+ Club
 
Posts: 925
Joined: Mon Jun 26, 2006 6:51 pm
Location: Essex, England

Postby Tomi on Fri Jun 30, 2006 3:31 pm

when i uploaded that i was told to place this into my code :

<? include 'index1.php' ?>


there is also a file on my server called stats.txt where the information is stored... i have CHMOD this to 777 as instructed, i dont have a clue why this doesnt work. The unique hits is the only part that doesnt work, the rest is fine.
User avatar
Tomi
500+ Club
 
Posts: 925
Joined: Mon Jun 26, 2006 6:51 pm
Location: Essex, England

Postby mwa103 on Fri Jun 30, 2006 8:34 pm

Can you post the code that you use to enter data into the stats.txt file? I think it will need a little tweaking. If you look at your txt file, all the entries are the same for each day so
Code: Select all
$daily_hosts_size = sizeof(array_unique($daily_hosts));

will only give you one "unique" entry. If you take the array_unique out it will give you more than 1 for a total.
If you are trying to keep track of unique visitors, you will have to change the code that writes to the file so that each entry can be distinguished. If you need help with this let us know.

-Mike
mwa103
100+ Club
 
Posts: 206
Joined: Mon Mar 07, 2005 10:55 pm

Postby mwa103 on Fri Jun 30, 2006 8:43 pm

Nevermind. I just needed to read closer. :oops:
Your problem is where you get the users IP:

Code: Select all
$line = $REMOTE_ADDR . "|" . $mday . $month . $year . "\n";

change this to:
Code: Select all
$line = GETENV("REMOTE_ADDR") . "|" . $mday . $month . $year . "\n";

or
Code: Select all
$line = $_SERVER['REMOTE_ADDR'] . "|" . $mday . $month . $year . "\n";


That's the way I do it on my site. See if that works.
-Mike
mwa103
100+ Club
 
Posts: 206
Joined: Mon Mar 07, 2005 10:55 pm

Postby Tomi on Sun Jul 02, 2006 5:54 pm

thanks :D
User avatar
Tomi
500+ Club
 
Posts: 925
Joined: Mon Jun 26, 2006 6:51 pm
Location: Essex, England


Who is online

Users browsing this forum: No registered users and 0 guests