Using Awstats to make a hitcounter - Printable Version -Shoutbox (https://shoutbox.menthix.net) +-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58) +--- Forum: Skype & Technology (/forumdisplay.php?fid=9) +---- Forum: Tech Talk (/forumdisplay.php?fid=17) +----- Thread: Using Awstats to make a hitcounter (/showthread.php?tid=45138) Using Awstats to make a hitcounter by user27089 on 05-22-2005 at 08:16 PM
Does anybody know how I can use Awstats to make a hit counter, I want it a text hit counter on my site, showing the "Hits" that I have received. RE: Using Awstats to make a hitcounter by saralk on 05-22-2005 at 08:23 PM
if your using php... code: I haven't tested it out, but it should work. RE: Using Awstats to make a hitcounter by RaceProUK on 05-22-2005 at 08:32 PM I'm no PHP person, but wouldn't you have a problem with '$file++;'? RE: Using Awstats to make a hitcounter by saralk on 05-22-2005 at 08:33 PM
that makes the number increase by one. RE: Using Awstats to make a hitcounter by RaceProUK on 05-22-2005 at 08:36 PM Looks more to me like (Increase file pointer by 1', or have I just too much C++? RE: Using Awstats to make a hitcounter by saralk on 05-22-2005 at 08:38 PM im not sure, i did that pretty quickly, i can't remember if $file = fread() will put the file contents in the var, or make it some sort of identification var. WDZ WDZ WDZ where for art thou? RE: Using Awstats to make a hitcounter by Eljay on 05-22-2005 at 08:39 PM
nah you need to do stuff in this order code: RE: Using Awstats to make a hitcounter by Veggie on 05-22-2005 at 08:53 PM
$blah++; RE: Using Awstats to make a hitcounter by RaceProUK on 05-23-2005 at 08:33 AM
LJ's code looks more correct to me. RE: Using Awstats to make a hitcounter by Eljay on 05-23-2005 at 08:36 AM
quote: yeh but what if the txt file contains like "1000 hits" ? it wouldnt change to 1001 because its not all integers EDIT: actually in this case mine wouldnt work RE: Using Awstats to make a hitcounter by Stigmata on 05-23-2005 at 08:52 AM
this works pefectly fine for me, and can go over 1000 code:just change hitcounter.dat to some filename and then run the page, the dat file should be created automaticly. but you will get a error on first run. RE: Using Awstats to make a hitcounter by -dt- on 05-23-2005 at 01:20 PM
quote:=/ why are you all making normal file based ones insted of ones that fetch their data from "awstats" quote: =/ why do you use r+ if your just going to read from it , you should just use r then open the file with w place your data and close it. OR use w+ read from the file then write to it and close the file like so... code: Really not the best code because of no error checking but eh... |