Topic: Hit Counter ... Basic Stuff Here
Hello,
Just scratching the PHP surface. A dilemma. I did a search on the topic here and came up empty, so ...
I have a site up, using Host Monster. It looks ok and the links work. I know enough PHP to have set up comment boxes to route comments to the intended targets and to be filed in phpMyAdmin in the HostMonster database so I can monitor them. No problem.
But now I am trying to set up a counter (invisible) to track visits. And I am aware of the pitfalls of this as an accurate gage of real traffic, but my site is so small that I simply want an idea of who shows up there. It's a hobby site, non-commercial.
The dilemma is this. All my pages are html. But I want to use PHP to set up the counter, preferably storing the results in a flat file. I understand the basics of how to read and write to one. BUT, without getting into the realm of htaccess, how can I manage to run the simple PHP counter code when all my pages are in HTML code? The server won't read it. This morning I had the bright idea of making my index.htm into index.php. Is that it? Simply save every page as PHP?
The simple coding examples I Googled say things like, "Just stick this (PHP) code at the very top of the page." Yep, but of course it won't be read unless the page extension is .php!!!!
I can't help but think I'm missing something VERY basic here. Thanks to anyone who can set me straight.
Mike
