【发布时间】:2013-05-01 19:07:23
【问题描述】:
我正在制作一个简单的下载计数器,但我不断收到标题错误,如 - 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();
?>
输出:
gvbdownload/gvb.txt
警告:无法修改标头信息 - 第 17 行 /home/kennyi81/public_html/dev/download.php 中的标头已由(输出开始于 /home/kennyi81/public_html/dev/download.php:1)发送
【问题讨论】:
-
看右边一栏的票数 -->
-
您的内容超出了错误...尽管它看起来很难缠住您,但在使用 header() 之前您无法回显或打印任何内容;
标签: php file header download counter