Showing posts with label counter. Show all posts
Showing posts with label counter. Show all posts

Sunday, June 26, 2016

Script Hit Counter In PHP

PHPGcount is a PHP graphical hit counter. It uses flat-text database so no SQL databases are necessary. It comes with many styles to choose from and you can add your own styles easily! It can count hits for multiple pages of your website or even websites on other servers. With the help of cookies it can count unique visits only.

The count is displayed on the page using a simple Javascript code.

Unlike other graphical hit counter scripts PHPGCount will work even on servers that dont have GD library enabled (this library is usually required by other scripts).


Download PHP Hit Counter


Monday, May 16, 2016

Counter and Hits With MySQL

Below is the script on how to make visitors counter based on Mysql database

create table on your database:

CREATE TABLE `counter` ( 
   `count_id` varchar (225) NOT NULL default, 
   `count` longtext NOT NULL, 
   `hits` longtext NOT NULL 
) TYPE = MyISAM; 

notes: 
for initial value for:
"count_id" enter the value 1 
"count"  enter the value 1 
"hits" enter the value 1 

below is the script for counter: 
<?php
session_start();
/* Database connection ----- begin ------- */
$dbhost = localhost; /* your host ----- ------- */
$dbusername = username; /* your user ----- ------- */
$dbpasswd = password; /* your password ----- ------- */
$database_name = database; /* your database name ----- ------- */

/* ----- Start db connection, code below do not change in ------- */
$connection = mysql_pconnect("$dbhost", "$dbusername", "$dbpasswd") or die ( "Could not connect to server.");
$db = mysql_select_db("$database_name", $connection) or die ( "Could not select database.");

/* Database connection out ----- ------- */

//  ----- If session "counted" has not been listed ------- *
if (!session_is_registered("counted")) {

/* ----- Update the cell "count" to add a +1 ------- */
mysql_query("UPDATE counter SET count = (count + 1) WHERE count_id = 1");

/* ----- Register session "counted" ------- */
session_register("counted");
}
?>

//script for visitor:
/* ----- Show value / value from the table "counter" column to the 2-I mean the "count" ------- */
$sql = mysql_query ("SELECT * FROM counter limit 1");
while ($row = mysql_fetch_array ($sql)) {
echo $row [1];
}
?>

script for hits:
<?php
/* ----- For the hits, we do not need the function "IF" ------- */
// Update cell ----- "hits" to add a +1 ------- */
mysql_query("UPDATE counter SET hits = (hits + 1) WHERE count_id = 1");

/* ----- Show value / value from the table "counter" column to the 3-I mean the "hits" ------- */
/* ----- Who has been in the process of update of the above ------- */
$sql = mysql_query ("SELECT * FROM counter limit 1");
while ($row = mysql_fetch_array($sql)) {
echo $row [2];
}
?>

Thursday, May 12, 2016

PHP Click Counter Script

CCount is a PHP click counter which can also be used as a download counter. With its help you can count clicks on any link on your website. A great tool if you want to know how many times a link has been clicked, a file downloaded ("download counter") and similar. You can also hide your affiliate links with PHP click counter. As long as its a link - Ccount can count clicks on it!

Ccount uses flat-text database so no SQL databases are necessary. It comes with an admin panel where you can view link statistics: how many times a link has been clicked (both numerical and graphical display of stats), link with most clicks and average clicks per link. You can also easily add, edit, reset or remove links in the admin panel or even display the number of clicks on any web page.


Download PHP Click Counter Script