Onbekend |
|
Ik heb een PHP uplaudscripts geinstalleerd op de volgende pagina:
http://members.lycos.nl/klama/upload.php
Nu ja de code zit hieronder:
<?php
error_reporting(E_ALL);
$map = "http://members.lycos.nl/klama/test.php"; // Map waar alles geupload wordt
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 "Mislukt!";
} else {
echo "Gelukt!";
}
} else {
if(IsSet($_POST['aantal'])) {
$aantal = $_POST['aantal'];
} else {
$aantal = 5;
}
?>
<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>
<br><br>
<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
}
?>
<input type="submit" name="submit" value="Uploaden">
</form>
<?php
}
?>
<?php $map = "http://members.lycos.nl/klama/test.php"; // Map waar alles geupload wordt function upload_file($fTmp, $fNew) { return false; } else { return true; } } if(IsSet($_POST['submit'])) { for($i = 0; $i < count($_FILES['bestand']['name']); $i++) { if(!upload_file($_FILES['bestand']['tmp_name'][$i], $map.$_FILES['bestand']['name'][$i])) { $error = true; } } } } else { } } else { if(IsSet($_POST['aantal'])) { $aantal = $_POST['aantal']; } else { $aantal = 5; } ?> <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> <br><br> <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 } ?> <input type="submit" name="submit" value="Uploaden"> </form> <?php } ?>
Zouden jullie even kunnen kijken waar de fout ligt. Wanneer ik een bestand via daar probeerde te uplauden kwam dit erop:
[b]Warning: copy(./store/e-mail adressen.htm): failed to open stream: No such file or directory in /data/members/free/tripod/nl/k/l/a/klama/htdocs/upload.php on line 10
Gelukt![/b]
|