I'm making a simple download counter but I keep getting a header error as seen on - http://dev.kennyist.com/download.php?file=gvb
<?
error_reporting(-1);
$file= $_GET['file'];
print $_GET['file'];
$countf= 'download/' . $file . '.txt';
print $countf;
$count = file_exists($countf) ? file_get_contents($countf) : 0;
file_put_contents($countf, ++$count);
header("Location: http://dev.kennyist.com/download/[$file].zip");
die();
?>
Output:
gvbdownload/gvb.txt
Warning: Cannot modify header information - headers already sent by (output started at /home/kennyi81/public_html/dev/download.php:1) in /home/kennyi81/public_html/dev/download.php on line 17