Mioplanet Documentation Center
Resources and Help
HomeProductsMioScriptJavaScriptTechNotesPHP
   Home | PHP | stats_write.php SEARCH    

stats_write.php

  Libraries
Admin Panel JavaScript Library
alertEngineEx.js
channels.js
gui.k
miodb_lib.php
mioEngine.js
miolib.js
mio_wlib.php
optionsMenu.js
popupAlert.kLIB
popupAlertEx.js
scrollingTicker.js
stats.js
stats_read.php
stats_write.php
window_resizable.k
xmlFeed.js
xmlSettings.js

  TechNotes
About MioEngine
About MioScript
Adding a Login feature
Admin Panel Configuration File: Account
Admin Panel Configuration File: Alerts
Admin Panel Configuration File: Channels
Admin Panel Configuration File: Servers
Admin Panel Configuration File: Software
Admin Panel Configuration File: Tasks
Admin Panel Installation Troubleshooting
Deploying an application remotely
Get the real size of a web page
How to create a Business Card
How to create a Desktop Alert
How to create a Desktop Ticker
How to create a Scrolling Alert Software
How to create a Scrolling Ticker
How to create a simple RSS Reader
How to debug
Installing Admin Panel on a server
LCD Monitor Chart: Screen Resolution, Size, Pitch, Display Area
Managing read marks
Measuring Elements in JavaScript
Media center remote control
Mio File Format
MioScript: Conditions
MioScript: Events
MioScript: Functions
MioScript: Loops
MioScript: Variables and Data Types
Programming MioScript
Statistics: How to track users and actions
Where to host Mioplanet Admin Panel
XML Configuration File Format

Library
stats_write.php

Language: PHP


The purpose of this PHP script is to save tracking information on a server.
This script can be used with the library stats.js or with the function mioxml_download.

The tracking information can be retrieved as XML with the script stats_write.php.

URL Arguments


The script receive the tracking information via the arguments sent with the URL.

.../stats_write.php?pid=...
 
This URL will record a hit for the specified software ID.

pid is the product ID.
 

.../stats_write.php?tid=...&gid=...
 
This URL will record a hit for the specified tracking ID, in the specified group ID.

tid is the tracking ID.
gid is the group ID. Most of the time, the GID of a tracking ID is the product ID.
 

How the information is stored


The information is saved in files stored in sub folders. The sub folders are located where the script stats_write.php is.

Databases are not used because the data stored is very small. The library stats.js stores individual information on the local computer to respect privacy and save both server resources and bandwidth.

/software/YEAR/PID/MONTH.mem
 
YEAR is the year.
PID is the product ID
MONTH is the month (two chars).

In the files are stored the number of users for each day of the month. The size of a file is less than 1 kb (12 kb / year / software).
 

/trackingID/YEAR/GID/TID.mem
 
YEAR is the current year.
TID is the tracking ID.
GID is the group ID.

In the file are stored the number of hits for each month of the year. The size of a file is less than 300 octets and is valid one year.
 

Getting feedback


When called, the script build a simple XML document to return the result to the caller.
The result is returned in a tag <R>.

In case of success, the script returns:
 
<R>OK</R>
 

In case of failure:
 
<R>Error: message</R>