Hi
Hope you can help me fast here, tried many forums without succes. Im a newbie in php.
On my homesite i have several freeware program that ive coded. I have every prg on a seperate page. To download the prg the visitor must click on a image to start download the file (using a href). What i want is that when the user click the image i want a following code to execute
<?php
$fp=fopen("theprogram.txt","r");
$count=fgets($fp,1024);
fclose($fp);
$fw=fopen("theprogram.txt","w");
$countnew=fputs($fw,$count+1);
fclose($fw);
?>
then the textfile increase the number with one, want to see how many downloads i have.
I have no problem to read and put the contents from the file to see downloadsnumber but i dont know how to put above code in my htmlcode.
Ive tried in onclick but dont execute.
Please solve this problem before all my hair is gone