-
-
Save lordSerega/d8ab7d0196b29e634de3932f04f72616 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!empty($_POST)) { | |
$image = $_FILES['image']['name']; | |
$target = "img/".basename($image); | |
if (move_uploaded_file($_FILES['image']['tmp_name'], $target)){ | |
[$imageWidth, $imageHeight] = getimagesize($target); | |
if ($imageWidth <= 300 && $imageHeight <= 300) { | |
echo "Файл больше"; | |
} else { | |
$this->db->query("INSERT INTO post (title,postDate,preview,textFull,postIMG) VALUES(?,?,?,?,?)", $_POST['title'], $_POST['postDate'], $_POST['preview'], $_POST['full'],$image); | |
header("Location: /"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment