PHP Tutorial : Simple views counter script
Dec 22, 2008 Useful PHP
Hi,
In this php tutorial you will learn the simple way to build a script which counts how many times a page is viewed. For this, we can use a mysql database table and a simple php script.
<?php
$pagename = $_SERVER['PHP_SELF'];
$sql = “select * from mysqltable where page = ‘$pagename’”;
$rs = mysql_query($sql);
if($rs) {
$row=@mysql_fetch_object($rs);
$counter = $row->counterfield;
//update the stats,…………….
Read PHP Tutorial : Simple views counter script »
Tags: count, count views, counter, counter script, number of views, php count, php counter, php views counter, views count, views counter, views script

