<?php
header('Content-Type: text/html; charset=utf-8');
$id = 0;
$file = "like.txt";
if(!is_file($file))
file_put_contents($file, $id);
if(isset($_POST['id'])){
$id = (int)file_get_contents($file);
$id++;
file_put_contents($file, $id);
}else
$id = (int)file_get_contents($file);
?>
<p>Всего лайков: <?=$id?></p>
<form method="post">
<input type="submit" value="Like" name="id">
</form>