i want to count the number of the clicks of a link and post the click count . i use the following code but it displays count as 0 . i can't figure the mistake where it is . however i can guess that the "Clicks" is not implemented properly in .. kindly help me please.
<?php
if( isset($_POST['clicks']) ) {
incrementClickCount();
}
function getClickCount()
{
return (int)file_get_contents("clickcount.txt");
}
function incrementClickCount()
{
$count = getClickCount() + 1;
file_put_contents("clickcount.txt", $count);
}
?>
<html>
<head>
<title>Click Count</title>
</head>
<body>
<a href="http://www.google.com" name="clicks">Google</a>
</ br>
</ br>
<div>Click Count: <?php echo getClickCount(); ?></div>
</body>
</html>