Forum Moderators: coopster
<a href="redirect.php?url=some_page.html">Link</a>
Now on your redirect page, you retrieve the url from the query string using the GET superglobal,
$_GET['url']. Once you have this value you check to see if it exists in a database, if it doesn't then you can add the link to the table. If it does, then you increment a field in the table that tracks how many times that page has been clicked on within your site. Now, if you want to know how many times the page is requested, even from referrers outside of your site, then you would need to add a header to each page and increment the associative value in the database corresponding to that page. So you see the method really depends on what kind of information you are looking to sort it by. We have a few threads in our library that help out with the mysql aspect of the coding if you want to take a peak at them as that part is basically the same for both solutions.
Here they are:
[webmasterworld.com...]
[webmasterworld.com...]
Good luck :)