Visit counter for single links

Asked

Viewed 510 times

0

I would like to make a counter views/ page accesses that take the link.

Ex.:

noticia.php? p=1 - 33 views

noticia.php? p=2 - 14 views

noticia.php? p=3 - 08 views

Can someone help me?

  • What do you really want? If you are going to generate a simple report, just check the user’s IP before recording to add up +1.

  • I intend to display it on a page that contains a news, signaling how many people have read or entered the link.

  • Before updating with +1, use an auxiliary table to record the IP of the person who accessed the news. If the IP is not in the table you sum +1, otherwise consider that the user has already read.

  • Generates a Session as soon as the user accesses the site does not count by IP, records the Session and puts as a counter, consider that the same computer can be shared and/or a shared network that is under the same IP.

  • @Diegovieira, did not consider that the user can remove the session cookie?

  • @PapaCharlie http://www.tuxradar.com/practicalphp/10/1/0

  • Guys, I’m in need of a script that counts the visits in a site posts, I wanted to use a get url type, but I don’t know much about PHP. If necessary I can use database. Someone would happen to have this script?

  • @Diegovieira, I don’t think you know that to have a session you need a cookie. PHP uses a cookie called PHPSESSID to identify the user. Just remove the cookie.

  • will have to use database yes, regardless if you use PHP Server, if apache restart you would lose everything that is in Session.

Show 4 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.