Log in

View Full Version : hits



Trigs
24-12-2007, 07:43 PM
Whats the PHP code for total hits and unique hits.

And is there a way to make them start at a certain number of hits

SixteenYears
26-12-2007, 06:44 PM
LOL uhm why would you want to "start at a certain number of hits." To make it seem like you have a lot of hits to your website? Lol why don't just start at 0 and work your way up like everyone else...

Trigs
26-12-2007, 07:08 PM
Because I already have 15545 hits and counting...
I'm using the habbohtml script right now but I want a text one

--ss--
26-12-2007, 07:15 PM
Create a .txt file called hits.txt (Or what ever you like) and CMod it to 777 , In the .txt file put in the number of hits you currently have.
Then add this code to the main page (Make sure the .txt is in the same directory as the main page)

$document = ("hits.txt");
$hits = file($document);
$hits[0] ++;
$fp = fopen($document , "w+");
fputs($fp , "$hits[0]");
fclose($fp);
Every time someone visit the page it will add 1 to the hits.txt file.

I'm not too sure on how to make it show unique hits only sorry (You could always just check your Awstats if you have Cpanel)

Trigs
26-12-2007, 07:23 PM
didn't work :(

do I need to echo it?

Want to hide these adverts? Register an account for free!