我已經嘗試了一切,有人可以幫助我嗎?我收到 3 個錯誤:foreach()...
PHP:8.0 MYSQL:5.1
foreach($_FILES["userfile"]["tmp_name"] as $key=>$tmp_name) {
$file_name=$_FILES["userfile"]["name"][$key];
$pasta_dir = "../www/layout/diario_de_obra/upload_img/";
$diretorio_img = $pasta_dir . $file_name;
$arquivo = $_FILES["userfile"]['tmp_name'][$key];
move_uploaded_file($arquivo, $diretorio_img);
print($file_name." enviado com sucesso!");
}
<div enctype="multipart/form-data"> <!-- action="upload" method="post" accept=”image/* -->
<label>Selecione as fotos de hoje aqui:
<input id="image-file" type="file" name="userfile[]">
<input id="image-file" type="file" name="userfile[]">
</label>
</div>
uj5u.com熱心網友回復:
在玩了你的例子之后,我想出了這個
<form action="imageUpload.php" method="post" enctype="multipart/form-data">
<div> <!-- action="upload" method="post" accept=”image/* -->
<label>Selecione as fotos de hoje aqui:
<input id="image-file" type="file" name="userfile[]">
<input id="image-file" type="file" name="userfile[]">
</label>
</div>
<button type="submit">click me</button>
</form>
現在你的 PHP 開始作業了。
轉載請註明出處,本文鏈接:https://www.uj5u.com/yidong/467735.html
上一篇:傳入引數的動態樞軸
下一篇:從一串數字生成行
