Use the header() function to send an HTTP Location header:
Contrary to what some think, die() has nothing to do with redirection. Use it only if you want to redirect instead of normal execution.
$fh = fopen('/tmp/track.txt', 'a');
fwrite($fh, $_SERVER['REMOTE_ADDR'] . ' ' . date('c') . "\n");
Hope it helps!!