KidsLovePC Contact Us
  Home   PHP  Graphics ASP  JavaScript   J2EE  HTML  JAVA   Swing   Webtip  Forums  Lyric  Free sheet music  Ringtones

PHP Counter

PHPCounter is a simple yet effective PHP hit counter which displays result in a graphical manner (with images). It uses flat-text database so no SQL databases are necessary. It can count hits for multiple pages of your website or even websites on other servers. To prevent others taking advantage of your script a HTTP referer validation has been included as an option.

This PHP counter may show hit counts in the following styles:

php hit counter
php hit counter
php hit counter
php hit counter
php hit counter
php hit counter
php hit counter
php hit counter
php hit counter
php hit counter
php hit counter
php hit counter
php hit counter
php hit counter

 

This tutorial includes the following section:

Download

The PHP Counter is downloadable here. It requires PHP 4 or higher.

Installation

  • Open file graphcount.php in your favorite PLAIN TEXT editor (like Notepad or Wordpad on Windows systems, DO NOT use MS Word or similar editor), scroll down to where it says "SETUP YOUR COUNTER" and set these variables:

$base_url - Set this to the URL of the folder where you will install PHPGcount. Make sure you add a "/" at the end of the folder URL.

EXAMPLE (let's say you want to install the counter in a folder called "phpgcount")
Correct: http://www.yourdomain.com/phpgcount/
Wrong: http://www.yourdomain.com/phpgcount

NOTE: For the first installation (to get it up and running as easy as possible) you may leave other variables (displayed below) as they are set by default.

$default_style - Default style of the images displayed by the counter. More info on styles further down.

$default_ext - Default image extension of your counter. If your default style consists of .jpeg images set it to "jpeg", if from .gif leave as it is etc.
NOTE: If you want to use any style that comes with PHPGcount by default, you should leave this variable set to "gif".

$check_referer - Enable referer validation (more inf further down).

$referers - Domains that are allowed to use the counter.

Save and close the graphcount.php file.
  • Upload graphcount.php file into a folder in your public directory (where the rest of your website is; usually "public_html", "www" or "site").
    Example: /public_html/phpgcount
    Corresponding URL: http://www.yourdomain.com/phpgcount/graphcount.php
  • Upload the "styles" folder to the same directory.
    Example: public_html/phpgcount/styles
    Corresponding URL: http://www.yourdomain.com/phpgcount/styles
  • Within the phpgcount folder create a new folder called "logs" (on many servers names are cassensitive). Make sure this folder is world-writable (on UNIX servers issue command CHMOD 777 (rwx-rwx-rwx))
    Example: public_html/graphcount/logs
    Corresponding URL: http://www.yourdomain.com/phpgcount/logs
  • Now to make your counter work just use this piece of code on your site:

<SCRIPT LANGUAGE="Javascript" SRC="http://www.domain.com/phpgcount/graphcount.php?page=PAGENAME"><!--
//--></SCRIPT>

Change the SRC parameter accordingly (to your graphcount.php URL)! Change PAGENAME to a unique name for each page you want track hits on (use numbers and letter only, no spaces or other chars).
Example:
On index.html you would use http://www.domain.com/phpgcount/graphcount.php?page=index
On someotherpage.html you would use http://www.domain.com/phpgcount/graphcount.php?page=otherpage
etc...

Try this and make sure your counter work before configuring it any more with options discussed below.

 

 

 

PHP Calendar
Comprehensive PHP Web Calendar
Configurable PHP Calendar
PHP Calendar
PHP Image Processing
PHP grahic softwares
PHP create real-time dynamic chart
create antispam image(image verification)
Add water mark to image
PHP Image processing introduction
Add text on Image
Create thumbnail for image
Create image from text on fly
PHP code sample
PHP create dynamic PDF with FPDF
PHP create dynamic PDF with PDFLib
PHP create dynamic PDF with ClibPDF
Improved PHP configurable hit counter
Install phpMyAdmin,MySql, PHP
PhpMyAdmin export/import data
A simple PHP RSS feed reader
PHP include (SSI)
Working with Forms
PHP formmail Generator
Using phpMyAdmin Create Database
Insert Form Data into Database
Retrieve data from Database
Retrieve multiple records
Batch insert text using phpMyAdmin
Using phpMyAdmin insert binary file
Insert binary file using PHP code
Using form insert binary file into MySQL
Retrieve binary file from MySQL
Image hosting business in minutes
Send HTML mail in PHP
Send bulk emails in PHP
Polling/Rating System in PHP
Polling/Rating System in PHP(radio button)
Check visitor's IP address
Check reciprocal link
PHP tutorial
What is PHP?
Install PHP on Windows XP (part1)
Install PHP on Windows XP (part2)
PHP open and closing tags
PHP types
Variables
Constants
Operators(part1)
Operators(part2)
Logic Structures
Include files
Loops
Set cookie and delete cookie
Most often used MySQL functions

 

 

Printer Inkjet A Z lyricsLearn ChineseHome|PHP|Swing|HTML|JavaScript|ASP|JAVA|Forum|WebTip|Contact Us
Copyright © kidslovepc.com All rights reserved(new). Privacy|Copyright
designed by info@kidslovepc.com

Please help us cover the web site maintenance fee.
barcode scanner Thermal Printer credit card machine bar code printer