FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » Keep track of page-access
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
Re: Keep track of page-access [message #172897 is a reply to message #172889] Fri, 11 March 2011 10:10 Go to previous messageGo to previous message
Beauregard T. Shagnas is currently offline  Beauregard T. Shagnas
Messages: 154
Registered: September 2010
Karma:
Senior Member
sl@exabyte wrote:

> Beauregard T. Shagnasty wrote:
>> sl@exabyte wrote:
>>> After some searching I intend to use AJAX and PHP to keep track of
>>> the number of times an HTML file (just a single file) has been
>>> accessed.
>>
>> AJAX not necessary. Just use a bit of PHP in the file to do
>> something simple like update a database .. a counter.
>>
>> Or as Doug says, look at your server logs.
>
> I suppose for PHP alone, the HTML file must end with ".php"
> extension.

...and for PHP and AJAX, too. <g> No, it does not need to be a ".php"
file extension. You can direct your "filename.html" to be processed as
PHP, via a simple line in your .htaccess file. (Assuming an Apache
server)

> For server logs alone, would it a problem if I need to keep the
> counter over, say, a few years. I hope not to clear the log every
> month.

Answered by others...

But my choice would be a dozen lines of PHP and a MySQL database table.
For "just a counter" you could simply increment a number (field) in a
one-row table, or you could add and store a new row for each page hit,
including further information such as visitor's IP address, browser UA
string, etc.

--
-bts
-Four wheels carry the body; two wheels move the soul
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Ritual Abuse
Next Topic: Backslash before function name in PHP
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Sun Nov 24 14:55:14 GMT 2024

Total time taken to generate the page: 0.04291 seconds