<?php
  $log = trim($log);
  $td = date("F jS");
  $date = date("d M, Y");
  $time = date("g:i a"); 
  $LogTime = trim(" Date: ".$date.", Time: ".$time);
  $fh = fopen("log.html",'a');
  fputs($fh, "<br><br>$LogTime.<br>$log"); 
  fclose($fh);
?>