Click to See Complete Forum and Search --> : Hit Counter Troubles


Culperat
January 3rd, 2008, 12:49 PM
Currently my work place is making a migration to a new server. On the new server, of which will not allow for perl scripts to be run. Our current hit counters use a perl script.

My first idea was just to make a php script that would do the same functionality. We don't want to have to go through all the htm pages and turn them into php. Because of this, I'm either unable to load php scripts in an htm page. Am I correct in this assumption?

I need an idea for how I would be able to handle including a hit counter in htm pages that could be dynamic enough that it can be used for multiple pages.

PeejAvery
January 3rd, 2008, 01:14 PM
Funny that you should mention this. I just finished writing a special hit counter for my website last night.

PHP can be configured to interpret *.htm/*.html files as PHP types. In the Apache configuration file (httpd.conf) you can add/edit the following.

AddType application/x-httpd-php .php .html
Also, PERL and PHP are very similar in many respects. You could easily create an identical counter in PHP from looking at the PERL code.