のヘッダー:エラー私はこのスクリプトを自分のサイトでダウンロードカウンターを作りたいPHP
<?php
$counter = 'apk/counter.txt'; // text file to store download count - create manually and put a 0 (zero) in it to begin the count
$download = 'http://site.my/apk/file.apk'; // the link to your download file
$number = file_get_contents($counter); // read count file
$number++; // increment count by 1
$fh = fopen($counter, 'w'); // open count file for writing
fwrite($fh, $number); // write new count to count file
fclose($fh); // close count file
header('Location: $download'); // get download
?>
しかし、結果は
警告言う:ヘッダー情報を変更することはできません - すでにによって送られたヘッダをライン上の /home/user/public_html/download.php
に(出力/home/user/public_html/download.php:1で開始しました)
どのようにそれを修正するには?
「<?php」の前のスペースを参照してください –
@ダゴン私はウェブサイトからスクリプトをコピーして貼り付けてしまいますので、スペースがあまり見えません<?php :(申し訳ありません –
上記のコードには、 –