|  Nieuw lid |  | ik heb een upload systeem nodig waarbij je meerdere bestanden tegelijkertijd kunt uploaden en waarbij de url in de database wordt gezet. ik heb al een scripje uit je libary (van php freakz) geplukt. zo moet het ongeveer worden maar dan dat de url van de plaatjes achter elkaar (in 1 veld) in de database worden gezet dus zo /plaatje1.gif,/plaatje2.jpg,/plaatje3.png 
 
 
    
    
        
            
                <?php
 error_reporting(E_ALL);
 require("../config.php"); 
 $map = $_SERVER['DOCUMENT_ROOT'] . "/plaatjes/"; // 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])) {
    $screens = $map.$_FILES['bestand']['name'][$i];
    mysql_query("insert into nieuws (screens) values ('plaatjes/$screens')") or die(mysql_error());
     $error = true;
    }
   }
  }
  if(IsSet($error)) {
   echo "Mislukt!";
  } else {
   echo "Gelukt!";
  }
 } else {
  if(IsSet($_POST['aantal'])) {
   $aantal = $_POST['aantal'];
  } else {
   $aantal = 4;
  }
?>
<form action="" method="post">
<input type="text" name="aantal" value="<?php echo $aantal; ?>" size="5"> <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 require("../config.php");  $map = $_SERVER['DOCUMENT_ROOT'] . "/plaatjes/"; // 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])) {    $screens = $map.$_FILES['bestand']['name'][$i];     $error = true;    }   }  }   } else {  } } else {  if(IsSet($_POST['aantal'])) {   $aantal = $_POST['aantal'];  } else {   $aantal = 4;  } ?><form action="" method="post"><input type="text" name="aantal" value="<?php echo $aantal; ?> " size="5"> <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 }?>
   
 kan iemand mij hier bij helpen?
 
 
 Citaat: vinTage edit code tussen[ code]bla bla[/ code] aub |