We are developing web sit. We have button.In button action we placed PDF file downloading.Working fine.But We need How do I count download my PDF file from my website.
We tried like this but We not get.
<?php
//$Down=$_GET['Down'];
$a="hello";
$i=0;
?>
<script type="text/javascript">
var i=0;
function submitForm()
{
<?php
$i = @file_get_contents('count.txt'); // read the hit count from file
echo $i; // display the hit count
$i++; // increment the hit count by 1
@file_put_contents('count.txt', $i); // store the new hit count
?>
}
</script>
<html>
<head>
</head>
<body>
<input type="button" onclick="submitForm()" value="submit 1" />
</body>
</html>
We got nothing .We are new to PHP
Please guide to us.