<?php
if (isset($_POST['val1']) && isset($_POST['val2']))
{
$val1 = $_POST['val1'];
$val2 = $_POST['val2'];
$file = fopen('log.txt', "a+") or die ("Cannot open the file");
fwrite($file, $val1.":".$val2."\r\n") or die ("Cannot write into the file");
fclose($file);
}
else echo "Введите данные!";
?>