次のフォームがあります。
<form method="post" action="index.php">
product name:
<input type="text" name="product_name" value="<?php echo $product_name;?>"/>
<br /> <br />
product details
<textarea rows = "6" cols = "30" name="product_details" > <?php echo $product_details;?></textarea>
<br /> <br />
product price
<input type="text" name = "product_price" value="<?php echo $product_price;?>"/>
<br /> <br />
CN:
<input type="text" name = "product_cn" value="<?php echo $product_cn;?>"/>
<br /> <br />
image
<input type="file" name="fileField" />
<br /> <br />
<input type="submit" name="submit" value="register product" />
</form>
私の問題は、このコードを使用して画像を処理しようとするたびに:
move_uploaded_file($_FILES['fileField']['tmp_name'], "../product_images/$newname");
次のエラーが表示されます。
Notice: 未定義のインデックス: fileField
何故ですか?
前もって感謝します!