This is a PHP script for counting and displaying simple statistics data of website traffic. Records and displays number of site visits and unique visitors, in the current and previous day, the number of online visitors in the last 60 seconds; as well as the top visits, visitors and record of online visitors, also, the IP of the current visitor.
The script is created with PHP. The traffic data can be saved in a text file on the server, or into a MySQL database (using PDO).
This script not records the accesses of bots engines (Googlebot, alexa, crawler, Gigabot, msn, ..., and others, total of 170 bots), and it can be included in both ".php" and ".html" files (but the server must run PHP).
It has been tested successfully on localhost (with XAMPP) and on the server of, with Mozilla Firefox, Internet Explorer, Google Chrome and Opera.
- Details about Installation and Settings you'll find in "Read.html" file, in the archive with the script.

• To Download it, click: Script - Website Mini-Traffic.

Demo - here's an example with traffic data displayed by this script

Traffic data Start: 9-Aug-2012
Now: 11-Aug-2013, 07:02
Total site visits: 231561
  - Most: 2178 8-May-2013
    •  Yesterday: 1789
    •  Today: 490
- Unique Visitors -
  - Record: 1250 8-May-2013
    •  Yesterday: 789
    •  Today: 190
- Online -
  - Record: 11 12-May-2013, 07:02
  - Most-Today: 5 00:09
  - Most-Yesterday: 8
  •  Now: 3

  Your IP:
PHP Script Website Mini-Traffic

Daily Test with Code Example

Which tag is used to include external CSS file in web page?
<body> <script> <link>
<link href="/templ/style.css" rel="stylesheet" type="text/css" />
Which CSS property sets the text size?
font-weight text-decoration font-size
h2 {
  font-size: 1em;
Indicate the JavaScript property that can add HTML code into an element.
text value innerHTML
document.getElementById("someID").innerHTML = "HTML content";
Click on the function that returns the number of characters of a string in PHP.
count() strlen() stristr()
$str = "";
$nr_chr = strlen($str);
echo $nr_chr;       // 22

Last accessed pages

  1. Bubble Tanks 3 (12045)
  2. Functions with Object and Array arguments (1478)
  3. Read Excel file data in PHP - PhpExcelReader (29409)
  4. AJAX with POST and PHP (6213)
  5. AJAX and Forms (824)

Top accessed pages

  1. Courses Web: PHP-MySQL JavaScript Ajax HTML CSS Flash-AS3 (37855)
  2. PHP-MySQL free course, online tutorials PHP MySQL code (29854)
  3. Read Excel file data in PHP - PhpExcelReader (29409)
  4. Get Attribute (ID, Class, Name, Title, Src) with jQuery (27540)
  5. PHP PDO - exec (INSERT, UPDATE, DELETE) MySQL (24385)