Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // image Upload File
- $target_file = "uploads/" . basename($_FILES["image"]["name"]);
- $imageFileType = pathinfo($target_file,PATHINFO_EXTENSION);
- $image = $_FILES['image']['name']; // The Thumbnail name
- $image_tmp = $_FILES['image']['tmp_name']; // File in the PHP tmp folder
- if($imageFileType != "jpg" && $imageFileType != "png" && $imageFileType != "jpeg" ) {
- $error = 1;
- }
- if (!$image_tmp) {
- $error = 2;
- }
- // error's
- if ($error == 1) {
- $message = "Sorry, only JPG, JPEG & PNG files are allowed.</br>";
- }
- if ($error == 2) {
- $message = "You need to choose a Thumbnail for your project!";
- }
- if ($_FILES["image"]["tmp_name"] == TRUE)
- {
- move_uploaded_file($_FILES["image"]["tmp_name"], $target_file);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement