Visit Counter
Previous  Top  Next

Unique visitors to the catalogue are counted by the counter.php script. It works automatically with the dynamic catalogue pages because catalogue.php calls counter.php each time that it is run.

When using OrderForm or OrderLink methods exclusively, the catalogue.php script is never called. In order to count visitors to HTML web pages, a small line of code must be inserted into the head of each page and the server must be configured to run PHP from within HTML files.

Here is the visit counter code that goes into the head of each page.
<? php include "counter.php"; ?>

Change the relative path to counter.php accordingly.
For instance, if the web page is in the public root and AShop is installed in the ashop subdirectory the code would look like this:
<? php include "ashop/counter.php"; ?>
If the page is down one directory from the counter script, it would be like this.
<? php include "../counter.php"; ?>

There are two ways to configure the server to run PHP from within HTML pages.

Method A.
Edit the configuration file for the web server (example is for apache) and add:
AddType application/x-httpd-php .php .phtml .php4 .php3 .html .htm

Method B.
Edit the directory configuration file (.htaccess for apache) and add:
AddType application/x-httpd-php .php .phtml .php4 .php3 .html .htm
Note: An example file htaccessORDERFORM.txt is included with the AShop distribution folder.