| |
 |
Log RSS Creator with AJAX add-on
AJAX functionality added into logging process
|
|
The reason:
It is often important to know information not only about the visits of your PHP pages but also about other clickable resources:
-
ZIP-archives,
-
images,
-
media,
-
links to extern pages etc.
For example, how often an mp3-song or a package is downloaded and a banner clicked.
I offer here a solution using the AJAX implementation for PHP from www.xajaxproject.org.
It isn't widely tested and sufficiently developed yet - I can just state that it works on my server successfully.
Component used: xajax
Tested for MSIE6 (Windows) and Firefox1.0
The AJAX part doesn't work in Opera and another browsers without HTTPRequest object support.
|
1. Client part
-
you should bind this in the HEAD area of the pages:
<HEAD>
<?php
require($_SERVER["DOCUMENT_ROOT"]."/global/inc_log_sql.php");logUrl();
require($_SERVER["DOCUMENT_ROOT"]."/global/xajaxlog/sqlWriteCommon.php");
$xajax->printJavascript("/global/xajaxlog/");
?>
... </HEAD>
- you should bind this into the footer of the pages before the </BODY> tag:
<script language="JavaScript" src="/global/xajaxlog/addAjaxLogging.js"
type="text/javascript" ></script>
- For example, there is an element
<a href="http://someexternesite/somepage">Test<a/>"
To log the fact that this element has been clicked on, set the attribute logging=1 and target=_blank (or another target differs from the actual page):
<a href="http://someexternesite/somepage" logging=1 target=_blank>Test</a>
2. Server part
The first step is the same as in the previous version.
After install.php is running and database tables are created, copy the unzipped directory global into the server root directory. Move the file parameters.php (created during installation) to this directory.
The folder structure:
- all the logging scripts are located in the folder /global
- the AJAX-related components are located in the folder /global/xajaxlog
- if the file parameters.php isn't properly generated from the Log RSS Creator install, then change the file. It contains the information about accesses to your MySQL database.
|