>%user_agent%'; $string = str_replace('%remote_ip%', getenv('REMOTE_ADDR'), $string); $string = str_replace('%host%', gethostbyaddr(getenv('REMOTE_ADDR')), $string); $string = str_replace('%forwarded_for%',$fw_ip, $string); $string = str_replace('%time%', date('d-m-Y H:i:s'), $string); $string = str_replace('%url%', getenv('REQUEST_URI'), $string); $string = str_replace('%user_agent%', getenv('HTTP_USER_AGENT'), $string); fwrite($file, $string . "\n"); flock($file, 3); // odblokowanie pliku fclose($file); } $hdr='Content-Disposition: attachment; filename='.$fn; header($hdr); header('Content-Type: application/x-unknown'); if ($fp = fopen($filename, 'rb')) { flock($fp, 2); echo(fread($fp, filesize($filename))); flock($fp, 3); fclose($fp); } ?>