ik heb een upload systeem en ik zou graag de nieuwste files bovenaan zetten weet iemand hier de code???
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>bestand uploaden</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<BODY BGCOLOR="000000">
<FONT COLOR="FFFFFF">
hier kan je bestanden uploaden.voor meerdere bestanden vul je het getal in en druk je op aantal bestanden.
<br>
druk dan op browse en selecteer de gewenste bestanden.
<br>
druk dan op uploaden.Je bestanden worden dan verzonden (dit kan wel even duren afhankelijk van het aantal bestanden en de grootte ervan.)
<br>

<?php
error_reporting(E_ALL);

$map = "./upload/"; // Map waar alles terecht komt

function upload_file($fTmp, $fNew) {
if(file_exists($fNew)) {
return false;
} else {
copy($fTmp, $fNew);
return true;
}
}

if(IsSet($_POST['submit'])) {
for($i = 0; $i < count($_FILES['bestand']['name']); $i++) {
if(IsSet($_FILES['bestand']['name'][$i]) && is_uploaded_file($_FILES['bestand']['tmp_name'][$i])) {
if(!upload_file($_FILES['bestand']['tmp_name'][$i], $map.$_FILES['bestand']['name'][$i])) {
$error = true;
}
}
}

if(IsSet($error)) {
echo "Er ging iets mis!";
} else {
echo "Het is gelukt!!";
}
} else {
if(IsSet($_POST['aantal'])) {
$aantal = $_POST['aantal'];
} else {
$aantal = 1;
}

?>
<form action="" method="post">
<input type="text" name="aantal" value="<?php echo $aantal; ?>" size="1"> <input type="submit" name="aantal_submit" value="Aantal bestanden">
</form>

<form action="" method="post" enctype="multipart/form-data">
<?php
for($i = 0; $i < $aantal; $i++) {
?>
Bestand <?php echo $i + 1; ?>: <input type="file" name="bestand[<?php echo $i; ?>]"> <br>
<?php
}
?> <br><br>
<input type="submit" name="submit" value="Uploaden">
</form>
<?php
}
?>
</FONT>
</body>
</html>
dit is de code van het upload systeem
de code die ik nodig heb gaat over de direction
zouden jullie mij willen helpen?
mvg koen

Reageren