Skip to content

Instantly share code, notes, and snippets.

@BlackMac
Created March 30, 2009 11:18
Show Gist options
  • Save BlackMac/87747 to your computer and use it in GitHub Desktop.
Save BlackMac/87747 to your computer and use it in GitHub Desktop.
Logs your time in timetrack
<?php
if (!isset($_GET['h'])) {
echo "No Hash given";
exit;
}
$logtime=date("Y-m-d\TH:i:s");
$action="#";
if ($_GET['d']=="in") $action="+";
if ($_GET['d']=="out") $action="-";
$logline=$action.'['.$logtime.'] ***'.$_GET['d'].'***'."\n";
$file=fopen('logs/'.$_GET['h'].'.log', 'a');
fputs($file, $logline);
fclose($file);
echo $logline;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment