500000) { echo "Sorry, your file is too large."; $uploadOk = 0; } // Check if $uploadOk is set to 0 by an error if ($uploadOk == 0) { echo "Sorry, your file was not uploaded."; // if everything is ok, try to upload file } else { if (move_uploaded_file($_FILES["fileToUpload"]["tmp_name"], $target_file)) { echo "The file " . htmlspecialchars(basename($_FILES["fileToUpload"]["name"])) . " has been uploaded."; header("Location: https://slovania.adlerka.top/index.php?dano"); } else { echo "Sorry, there was an error uploading your file."; } } } else { $skeleton = file_get_contents('templates/skeleton.html'); $menu_obsah = file_get_contents('templates/header.html'); $out = str_replace('__TEMPLATE_HEADER__', $menu_obsah, $skeleton); $footer_obsah = file_get_contents('templates/footer.html'); $out = str_replace('__TEMPLATE_FOOTER__', $footer_obsah, $out); $nazov_stranky = basename($_SERVER['QUERY_STRING']); if (empty($nazov_stranky)) { $nazov_stranky = 'index'; } if (!empty($_GET["listfiles"])) { $files = scandir($target_dir); $out = "Názov súboruDownload"; foreach ($files as $file) { if (!str_starts_with($file, '.')) { $filename = $file; $displayname = explode('.', $filename)[0]; $filepath = "/uploads/$file"; $out .= "$displayname$filename"; } } } else { $cesta_k_stranke = "stranky/$nazov_stranky.html"; if (!file_exists($cesta_k_stranke)) { $cesta_k_stranke = "templates/header1.html"; } $stranka_obsah = file_get_contents($cesta_k_stranke); $out = str_replace('__TEMPLATE_STRANKA__', $stranka_obsah, $out); $cesta_k_skriptu = "scripty/$nazov_stranky.js"; $script_obsah = ""; if (!file_exists($cesta_k_skriptu)) { $script_obsah = ''; } $out = str_replace('__TEMPLATE_SCRIPT__', $script_obsah, $out); $cesta_k_stylu = "styles/$nazov_stranky.css"; $style_obsah = ""; if (!file_exists($cesta_k_stylu)) { $style_obsah = ''; } $out = str_replace('__TEMPLATE_STYLE__', $style_obsah, $out); } echo $out; }