アップロードが成功した後、次のページにジャンプすると思いますが、この警告が表示されます。 「ヘッダーの警告を取り除く方法
警告:ヘッダー情報を変更することはできません - すでにによって送られたヘッダ(出力はCで開始:\ XAMP \ xamppの\ htdocsに\ギャラリーの\ uploader3.php:25)Cに:\ XAMP \ xamppの\ htdocsに\ここ
ライン51上のギャラリーの\ uploader3.phpはコードです:
<html>
<head>
<title> Sample1 - File Upload on Directory </title>
</head>
<body>
<div align="center">
<form action="uploader3.php" method="post" enctype="multipart/form-data" >
<input type="hidden" name="MAX_FILE_SIZE" value="100000" />
Create an Album (limited to 10 images): <br />
<input type="file" name="uploadedfile[]" /><br />
<input type="file" name="uploadedfile[]" /><br />
<input type="file" name="uploadedfile[]" /><br />
<input type="file" name="uploadedfile[]" /><br />
<input type="file" name="uploadedfile[]" /><br />
<input type="file" name="uploadedfile[]" /><br />
<input type="file" name="uploadedfile[]" /><br />
<input type="file" name="uploadedfile[]" /><br />
<input type="file" name="uploadedfile[]" /><br />
<input type="file" name="uploadedfile[]" /><br />
<br />
<input type="submit" value="Upload File" />
</form>
</div>
<?php
$target_path = "uploads1/";
if(!file_exists($target_path))
{
if(!mkdir($target_path))
{
die ("could not create the folder");
}
}
else
{
for($count = 0; $count < count($_FILES['uploadedfile']); $count++)
{
$target_path = $target_path . basename($_FILES['uploadedfile']['name'][$count]);
if(move_uploaded_file($_FILES['uploadedfile']['tmp_name'][$count], $target_path))
{
/*echo "The file ". basename($_FILES['uploadedfile']['name'][$count]).
" has been uploaded";*/
}
else
{
echo "There was an error uploading the file, please try again!";
}
}
}
header('Location: index.html');
?>
</body>
</html>
どのように私はこの問題を解決することができますか?ありがとうございました! :D
私のポストに投票しないでください.. PHPで新しい.. ..( – SimonCode
あなたのコードの流れを再考する必要があります。 –
[PHPで既に送信されたヘッダー](0120-912-066)(英語) – Jocelyn