Page Counter in PHP J query





J QUERY FIles

<script type="text/javascript" src="js/jquery-1.8.3.min.js"></script>
<script type="text/javascript" src="js/counter.js"></script>

CSS


<style type="text/css">
body{width:80%;margin:0 auto;font-family:Tahoma, Geneva, sans-serif;}
.warp{width:300px;margin:0 auto;}
.jfc{cursor:pointer;background:url(img/dots.gif) repeat-x scroll center bottom;}
.jre{font-size:15px; text-align:center;color:#0e4183;display:table;clear:both}
.jb{color:#424242;float:left;font-size:12px;font-weight:bold}
.cd{float:left;list-style-type:none;margin:0;padding:0;width:auto}
.jb{color:#424242;float:left;font-size:12px;font-weight:bold}
.cd{float:left;list-style-type:none;margin:0;padding:0;width:auto}
.t{background:url(img/cont2.png) no-repeat;height:22px;width:30px}
.b{background:url(img/cont1.png) no-repeat;height:35px;width:30px}
.s{background:url(img/comma.gif) no-repeat scroll 2px 32px;height:43px;width:12px}
.jpr{clear:left;display:table;margin:0 auto;padding:30px 0 35px;width:950px}
.jpr a{text-align:center;padding:5px 0 0 0;color:#ff6c00}
.jpr .flat,.jpr .wip{margin:0;padding:5px 0 0;width:215px}
.jpr span{color:#ff6c00;font-size:14px;font-weight:bold;float:left;text-align:center;padding:5px 0 0 0}
.jpr .jsel{color:#424242}.dl{border-right:1px solid #b0b0b0;float:left;height:15px;margin:8px 0 0;width:1px}
.jpfl{width:483px}
</style>

HTML

<div class="warp" >
<section class="jfc" id="fct" onclick="javascript:review_rating_page('01');_ct('review','hmpg');">
</section>
</div>



PHP + JQuery

<?php
$count_my_page = ("hitcounter.txt");
$hits = file($count_my_page);
$hits[0] ++;
$fp = fopen($count_my_page , "w");
fputs($fp , "$hits[0]");
fclose($fp);
$hits[0];
?>
<script type="text/javascript">
var intcnt = <?php echo $hits[0];?>;
//document.write(intcnt);
var myCounter = new flipCounter('fct', {value:intcnt, inc:123, pace:600, auto:false});
</script>