初めてなので情報がありません。画像のサイズを変更する必要があります。
これは私のコードです。
if(!empty($_FILES['img']['name'])){
$extension = end(explode(".",$_FILES['img']['name']));
$name = $_FILES['img']['name'];
$size = $_FILES['img']['size'];
if(file_exists("views/admin/uploads/".$name)){
$errors[] = "File with this name already exists!";
}
if($extension != "jpg" && $extension != "png" && $extension != "gif" && $extension != "JPG"){
$errors[] = "Unknown file format!";
}
}
if(count($errors)==0){
$query = mysql_query("INSERT INTO `avetisyan`.`news` (`id`, `category`, `title`, `img`, `short_content`, `content`, `date`, `lang`) VALUES (NULL, '$category', '$title', '$name', '$short_content', '$long_content', '$date', '$lang')");
move_uploaded_file($_FILES['img']['tmp_name'],"views/admin/uploads/".$name);
echo "<h2 align=\"center\">Successfully added!</h2>";
}
else{
print "<h3>Errors!</h3><ul><li>".join("</li><li>",$errors)."</li></ul>";
}