<form action = "index.php" method = "POST" enctype = "multipart/form-data">
<input type = "file" name = "image_name" /><input type = "submit" value = "Upload" name = "upload"/>
</form>
<?php
include("connect.php");
if(isset($_POST['upload'])){
$file = file_get_contents($_FILES['image_name']['tmp_name']);
$name = $_FILES['image_name']['name'];
$image_size = getimagesize($_FILES['image_name']['tmp_name']);
if($image_size == false){
echo "Thats not an image.";
}
}
?>
出现错误。如何避免错误通知?
这是错误消息:
注意:getimagesize() [function.getimagesize]: 读取错误!在第 16 行的 C:\xampp\htdocs\picture\index.php