现在都在使用php5了
计数器代码可写做
$filename='count2.txt'; 
$count = file_get_contents($filename); 
$count++;  
file_put_contents($filename, $count);如要使下载文件的大小正确,需要加入
Header("Accept-Ranges: bytes");
Header("Accept-Length: ".filesize("apache2.rar"));
在header('Content-Disposition: attachment; filename="apache2.rar"'); 之前