Recept uploaden"; $i = 0; $hoofdmap = 'recepten/'; $overzicht = opendir($hoofdmap); while ($b = readdir($overzicht)) { if (($b != ".")&&($b != "..")&&($b != "index.php")) { $mappen[$i] = $b; $i++; } } closedir($overzicht); sort($mappen); reset($mappen); echo "
"; echo "
"; echo "Nieuwe map:

"; echo ""; if ((isset($_POST['map']))AND ($_POST['nieuw'] != "")) { $mappen[] = $_POST['nieuw']; sort($mappen); } if ((isset($_POST['map']))AND ($_POST['nieuw'] == "")) { echo "
Kies een naam voor de map.
"; } echo "
"; echo "
"; echo "

Kies het document:

"; echo "Document:

"; if ((isset($_POST['upload']))AND($_POST['bestand'] == "")) { echo "
Kies een document door te bladeren.
"; } echo "

Klik op de doelmap:

"; for ($t = 0; $t < sizeof($mappen); $t ++){ $m = ucfirst($mappen[$t]); echo "".ucfirst($mappen[$t])."
"; } echo "
"; $m = $_POST['upload']; $uploadmap = "recepten/".strtolower($m)."/"; if(!file_exists($uploadmap)){ mkdir($uploadmap); chmod ($uploadmap, 0777); } $bestand = $_FILES['bestand']['tmp_name']; if(is_uploaded_file($bestand)){ $bestandsnaam = $_FILES['bestand']['name']; $bestandstype = $_FILES['bestand']['type']; $bestandsgrootte = round($_FILES['bestand']['size']/1024).' Kb'; move_uploaded_file($bestand,$uploadmap.$bestandsnaam); echo ""; } echo "
Recepten bekijken
"; ?>