diff --git a/20241024/head.php b/20241024/head.php index 83918d7..d7c520c 100644 --- a/20241024/head.php +++ b/20241024/head.php @@ -3,7 +3,40 @@ if ($_SERVER["REQUEST_METHOD"]=="POST"){ $celkonyvtar = "kepek/"; - $celfajl = $_FILES["kepfajl"]["name"]; + $celfajl = $celkonyvtar.$_FILES["kepfajl"]["name"]; - var_dump($_FILES["kepfajl"]); + $maxmeret = 5 * 1024 * 1024; + $kepkiterjesztes = strtolower(pathinfo($celfajl, PATHINFO_EXTENSION)); + $uploadOK = 1; + + if(getimagesize($_FILES["kepfajl"]["tmp_name"]) == false){ + $uploadOK = 0; + echo "nem kép lett megadva"; + } + + if($_FILES["kepfajl"]["size"] > $maxmeret){ + $uploadOK = 0; + echo "Túl nagy állomány"; + } + + + if($kepkiterjesztes != "jpg" && $kepkiterjesztes != "png"){ + $uploadOK = 0; + echo "nem megengedett formátum"; + } + + if($uploadOK == 1){ + if(move_uploaded_file($_FILES["kepfajl"]["tmp_name"],$celfajl)){ + $_SESSION["kepek"][] = $celfajl; + } + } + + + //var_dump($_FILES["kepfajl"]); } + +if (isset($_SESSION["kepek"])){ + foreach($_SESSION["kepek"] as $key => $value){ + echo ""; + } +} \ No newline at end of file diff --git a/20241024/kepek/langos.jpg b/20241024/kepek/langos.jpg new file mode 100644 index 0000000..106dd22 Binary files /dev/null and b/20241024/kepek/langos.jpg differ diff --git a/20241024/kepek/skull_1.jpg b/20241024/kepek/skull_1.jpg new file mode 100644 index 0000000..95d4eb1 Binary files /dev/null and b/20241024/kepek/skull_1.jpg differ