Re: Tracking all visits to the page

From: Denis McMahon <denismfmcmahon_at_gmail.com>
Date: Tue, 14 Oct 2014 22:23:34 +0000 (UTC)
Message-ID: <m1k7p6$jfo$1_at_dont-email.me>


On Tue, 14 Oct 2014 16:13:18 -0400, Thor wrote:

> Thank you. I know all about the IP may change at will and that. I just
> want to know the total number of hits per page. So I tried setting up a
> table that will track the page hits by page.But does not seem to be
> working.

> $result = mysqli_query($link,"SELECT * FROM page");
> mysqli_query($link,"INSERT INTO video1 (name,hits) VALUES ("video1",1)
> ON DUPLICATE KEY UPDATE hits=hits+1")
> or die(mysqli_error());


^^^^^^^ never use "or die" in production code. It can expose a great deal 
of information about your website which is of use to a hacker wishing to take over your server for botnet c&c, and is very user unfriendly. If you think there's a chance of an error, catch the error condition and handle it gracefully.

> mysqli_close($link);

What output do you expect?
What output is it generating?

-- 
Denis McMahon, denismfmcmahon_at_gmail.com
Received on Wed Oct 15 2014 - 00:23:34 CEST

Original text of this message