I have a image:
<img src="imagini/floo.gif" onclick="score()">
and i want "on click" to be opened a file "c.txt". That file's content is: 0
And i want on every click, to be added 100 in c.txt.
I want something like this:
<img src="imagini/floo.gif" onclick="score()">
<script> function score(){ (..do file add.php ...) }</script>
And add.php:
<?php
$c = "c.txt";
$fh = fopen($c, "r");
$current = fread($fh, filesize($c));
fclose($fh);
$current++;
$fh = fopen($c, "w");
fwrite($fh,$current);
fclose($fh);
?>
What to put in place: "(..do file add.php ...)" for the code to work?