Are all hit counters PHP?

Soldato
Joined
18 Oct 2003
Posts
19,415
Location
Midlands
As title really?

If i want a nice hit-counter on a site, something i can customise and not one of those sign-up jobbys does it want to be PHP.
 
Right, well, im on hot-scripts.. whats the easiest way to implement a hit counter? basically just text really is all i want..
 
Hmm, those stat sites appear overkill for my needs and the tutorials im seeing there appear to be PHP, which im quite happy to use, but does mean a lot of link changes.

cheers for the help
 
gord said:
Hmm, those stat sites appear overkill for my needs and the tutorials im seeing there appear to be PHP, which im quite happy to use, but does mean a lot of link changes.

cheers for the help
Link changes as all your files end in .htm/html?

You can set apache up to treat html as .php :)

Plunk the following into your .htaccess file:

Code:
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

Tada: http://www.desilva.biz/php/phpinhtml.html
 
jdickerson said:
Link changes as all your files end in .htm/html?

You can set apache up to treat html as .php :)

Plunk the following into your .htaccess file:

Code:
RemoveHandler .html .htm
AddType application/x-httpd-php .php .htm .html

Tada: http://www.desilva.biz/php/phpinhtml.html

wow you genius, wish i had known this ages ago as the amount of times i have had to change every single page and every single link from html to php. you have just saved me so much annoying work, thankyou
 
Mammalian said:
wow you genius, wish i had known this ages ago as the amount of times i have had to change every single page and every single link from html to php. you have just saved me so much annoying work, thankyou
:)

I accept VISA/Mastercard and Cheques.

You could also change .htm/l using search replace intra-document and use something like ruby/dos even (ruby/bash on mac) to change every *.htm --> .php but my way is easier.
 
not the best way though, passing every .html page through the PHP interpreter will waste a whole lot of CPU cycles, considered that just about every .html file except for your mad php concoction is static html and requires no interpretation by the server.
 
I don't think there are many security issues with a simple counter. PHP is server-side scripting unlike javascript which is clientside. The main vunerabilities in PHP come when user-supplied data is used such as a form.
 
Back
Top Bottom