html5andphp: Making Counter Using Php

Saturday, 27 July 2013

Making Counter Using Php

Making Counter using php and html with the help of file handling.

Cont your real visiter using this very simple counter.

<?php
error_reporting(0);
$file = file_get_contents("counter.txt");
$data=$file;
$newdata=$data+1;
$newfile=fopen("counter.txt","w");
fwrite($newfile,$newdata);
?>
<html>
<table width="auto" border="2" cellspacing="2" cellpadding="2" bgcolor="#00FFFF" bordercolor="#0000FF" >
  <tr>
    <td><?php echo $newdata;  ?></td>
  </tr>
</table>
</html>

Output



For more on php visit php-tutorial


Download PHP PDF php basic tutorial pdf


counter

No comments: