Hi all,
I want to be able to count downloads of files. Ideally Id love to be able to type <a href=# onClick="counter()" where counter is a php function, but obviously i cant.
Can anyone think of a workaround for this alogrithm ( I know the code is wrong its the problem im trying to solve not the syntax)
--snip---
<a href=# onClick="counter()">CLICK HERE TO DOWNLOAD FILE </a>
<?php
function counter()
{
tempcounter=select counter from table
tempcounter++
update table set counter=tempcounter
}?>
I dont want to increment the counter until the link to the file is actually clicked.
How do other people count file downloads using PHP / MYSQL?
Thanks
Darren
I want to be able to count downloads of files. Ideally Id love to be able to type <a href=# onClick="counter()" where counter is a php function, but obviously i cant.
Can anyone think of a workaround for this alogrithm ( I know the code is wrong its the problem im trying to solve not the syntax)
--snip---
<a href=# onClick="counter()">CLICK HERE TO DOWNLOAD FILE </a>
<?php
function counter()
{
tempcounter=select counter from table
tempcounter++
update table set counter=tempcounter
}?>
I dont want to increment the counter until the link to the file is actually clicked.
How do other people count file downloads using PHP / MYSQL?
Thanks
Darren