Php-mysql Course

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 CoursesWeb.net, 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:   109.210.78.90

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which tag is used to add lists into <ul> and <ol> elements?
<dt> <dd> <li>
<ul>
 <li>http://coursesweb.net/html/</li>
 <li>http://coursesweb.net/css/</li>
</ul>
Which value of the "display" property creates a block box for the content and ads a bullet marker?
block list-item inline-block
.some_class {
  display: list-item;
}
Which instruction converts a JavaScript object into a JSON string.
JSON.parse() JSON.stringify eval()
var obj = {
 "courses": ["php", "javascript", "ajax"]
};
var jsonstr = JSON.stringify(obj);
alert(jsonstr);    // {"courses":["php","javascript","ajax"]}
Indicate the PHP class used to work with HTML and XML content in PHP.
stdClass PDO DOMDocument
$strhtml = '<body><div id="dv1">CoursesWeb.net</div></body>';
$dochtml = new DOMDocument();
$dochtml->loadHTML($strhtml);
$elm = $dochtml->getElementById("dv1");
echo $elm->nodeValue;    // CoursesWeb.net
PHP Script Website Mini-Traffic

Last accessed pages

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (141748)
  2. Add, Change, and Remove Attributes with jQuery (46356)
  3. Node.js Move and Copy file (28419)
  4. Rectangle, Oval, Polygon - Star (3322)
  5. PHP PDO - prepare and execute (9187)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (472)
  2. CSS cursor property - Custom Cursors (78)
  3. The Mastery of Love (69)
  4. PHP-MySQL free course, online tutorials PHP MySQL code (62)
  5. CSS3 2D transforms (46)