Monday 30 September 2013

How to implement a code generator service for web counter with php or javascript?

How to implement a code generator service for web counter with php or
javascript?

hits.php :
<?php
$counts = ("counter.txt");
$hits = file($counts);
$hits[0] ++;
$fp = fopen($counts, "w");
fputs($fp , "$hits[0]");
fclose($fp);
header("Content-type: text/javascript");
echo "document.write('" . $hits[0] . "');";
?>
<script type="text/javascript" src="hits.php"></script>
how can i use database for this? any body have other idea for this servic?
tnx

No comments:

Post a Comment