PHP PROJECT

README.md

Count user visits and display in a image widget

This class count user visits and display in a image widget. It can record the accesses of site visitors in a MySQL database. The class can also generate an image for a widget that displays the number of visitors of the site pages. The image widget details like font color, font style, font, background color can be configured.

Files


NameTypeSizeLast Modified
HCW_class.php phpfile icon 6289 31 January 2017 01:34:20
HCW_widget.php phpfile icon 384 14 January 2016 09:51:20
example.php phpfile icon 337 14 January 2016 09:51:20
HCW_example.php phpfile icon 337 14 January 2016 09:51:20
HCW_SQL.txt textfile icon 615 14 January 2016 09:51:20
hc directory icon 4096 31 March 2017 08:37:26
HCW_config.php phpfile icon 314 14 January 2016 09:51:20
template directory icon 4096 31 March 2017 08:37:26

Source

  1. CREATE TABLE `hcw_hitcounter` (
  2.   `id` bigint(10) NOT NULL AUTO_INCREMENT,
  3.   `fcolor` varchar(6) NOT NULL,
  4.   `bgcolor` varchar(6) NOT NULL,
  5.   `fsize` int(2) NOT NULL,
  6.   `bcolor` varchar(6) NOT NULL,
  7.   `bwidth` int(2) NOT NULL,
  8.   `cstart` bigint(10) NOT NULL,
  9.   `ctype` int(2) NOT NULL,
  10.   `pid` int(10) NOT NULL,
  11.   `ffstyle` varchar(20) NOT NULL,
  12.   `md` varchar(65) NOT NULL,
  13.   `width` int(2) NOT NULL,
  14.   `url` varchar(120) NOT NULL,
  15.   `stat` tinyint(1) NOT NULL,
  16.   `timestamp` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  17.   PRIMARY KEY (`id`)
  18. ) ENGINE=MyISAM AUTO_INCREMENT=1 DEFAULT CHARSET=utf8;

Demo

You can find a demo available here: Hit Counter

Requirment

  • mySql
  • PHP >= 5.4
  • Apache Server

Contribute

  • Vishv Sahdev

Example

  1. <?
  2. require("HCW_class.php");
  3. require("HCW_config.php");
  4.     if(isset($_POST['ok']) && $_POST['ok'] == "ok"){
  5.     $hcw->transfer($_POST);
  6.     }
  7.     else
  8.     $hcw->ar['mc']='';
  9.     
  10.     $hcw->ar['font']=$hcw->findTTF();
  11.     
  12.     if(is_file("./template/HCW_template.php")){
  13.             echo $hcw->render_temp("./template/HCW_template.php",$hcw->ar);
  14.     }
  15.     

>>

Download