Ratings | | Unique User Downloads | | Download Rankings |
68% | | Total: 361 | | All time: 6,902 This week: 206 |
|
Description | | Author |
This class can generate links and keep track of clicks on them.
It can take the URL of a given link and returns another URL that will be used to keep track of the clicks on that link.
The link points to a script that will be used to record the clicks on a database accessed via PDO, and then it redirects the browser to the original link.
Alternatively the class can also store the clicked links of text files.
The database connection string, the URL for invalid links, the destination link base URL, the file for storing click counts are some of the configurable parameters. | |
|
|
Innovation award
Nominee: 3x |
|
Recommendations
Example
<?php
require_once 'core/CCounter.class.php';
$CC=new CCounter();
?>
<html>
<head>
<title>Click Counter Example</title>
</head>
<body>
<h1>Click Counter PHP - Example use</h1>
<p>Click a link to increase the relative counter.</p>
<a href="<?php print_r($CC::getHref('link1.html')); ?>" target="_blank">Link1</a><br/>
<a href="<?php print_r($CC::getHref('link2.html')); ?>" target="_blank">Link2</a><br/>
<a href="<?php print_r($CC::getHref('link3.html')); ?>" target="_blank">Link3</a><br/>
<a href="<?php print_r($CC::getHref('link4.html')); ?>" target="_blank">Link4</a><br/>
<a href="<?php print_r($CC::getHref('link5.html')); ?>" target="_blank">Link5</a> (404 page, link broken example)
</body>
</html>
|
Details
ClickCounter
ClickCounter is a PHP class that allows you to control the number of visitors who clicked on certain links. Useful for statistics on navigation and \ or downloading files.
How use it
To use the class will need, call the static method getHref class CCounter, passing as the only argument the link
Example:
If the link is unreachable, the class will direct the browser to the 404 page indicated in configurations.
|
Applications that use this package |
|
No pages of applications that use this class were specified.
If you know an application of this package, send a message to the author to add a link here.