login  Naam:   Wachtwoord: 
Registreer je!
 Forum

Uploadscript, werkt niet!

Offline Martijn1989 - 12/05/2006 23:41
Avatar van Martijn1989PHP ver gevorderde Ik gebruik dit :

  1. <?php
  2.  
  3. $map = "foto/"; // Map waar alles geupload wordt
  4.  
  5.  
  6.  
  7. if(IsSet($_POST['submit'])) {
  8.  
  9. $selectl = mysql_query("SELECT * FROM `fotos_foto` ORDER BY `id`DESC LIMIT 1");
  10. $aantall = mysql_num_rows($selectl);
  11.  
  12. if($aantall > 0) {
  13.  
  14. $objl = mysql_fetch_assoc($selectl);
  15.  
  16. $aantalll = $objl['id'];
  17.  
  18. } else {
  19.  
  20. $aantalll = 1;
  21.  
  22. }
  23.  
  24. for($i = 0; $i < count($_FILES['bestand']['name']); $i++) {
  25.  
  26. if(!move_uploaded_file($_FILES['bestand']['name'][$i],$map.$_FILES['bestand'][$aantalll]))
  27. {
  28. echo "Fout";
  29.  
  30. } else {
  31. mysql_query("INSERT INTO `fotos_foto` (ida) VALUES ('". $_POST['album'] ."')") or die (Mysql_Error());
  32. echo "Bestand ". $i ." : Gelukt!<br>";
  33. }
  34.  
  35. }
  36. }
  37. if(IsSet($_POST['aantal'])) {
  38. $aantal = $_POST['aantal'];
  39. } else {
  40. $aantal = 5;
  41. }
  42.  
  43. $select = mysql_query("SELECT * FROM `fotos_albums`") or die (Mysql_Error());
  44. $aantal2 = mysql_num_rows($select);
  45.  
  46. if($aantal2 == 0) {
  47.  
  48. echo "<b>Maak eerst een album aan!<b>";
  49.  
  50.  
  51. } else {
  52.  
  53. ?>
  54. <form action="" method="post">
  55. <input type="text" name="aantal" value="<?php echo $aantal; ?>" size="1">&nbsp;<input type="submit" name="aantal_submit" value="Aantal bestanden">
  56. </form>
  57. <br><br>
  58. <form action="" method="post" enctype="multipart/form-data">
  59. <select size="1" name="album">
  60. <?php
  61.  
  62. while($obj = mysql_fetch_assoc($select)) {
  63.  
  64. echo "<option value='". $obj['id'] ."'>". $obj['naam'] ."</option>";
  65.  
  66. }
  67. echo "</select><br>";
  68.  
  69. for($i = 0; $i < $aantal; $i++) {
  70. ?>
  71. Bestand <?php echo $i + 1; ?>: <input type="file" name="bestand[<?php echo $i; ?>]"><br>
  72. <?php
  73. }
  74. ?>
  75. <input type="submit" name="submit" value="Uploaden">
  76. </form>
  77. <?php
  78. }
  79.  
  80. ?>


De map foto heeft de 777 rechten. Maar krijg dus fouten ala :

Citaat:
Notice: Undefined index: 3 in /home/partykick/domains/partykick.nl/public_html/admin.php on line 205

Warning: move_uploaded_file(foto/): failed to open stream: Is a directory in /home/partykick/domains/partykick.nl/public_html/admin.php on line 205

Warning: move_uploaded_file(): Unable to move '/tmp/phpvvAbBW' to 'foto/' in /home/partykick/domains/partykick.nl/public_html/admin.php on line 205
Fout
Notice: Undefined index: 3 in /home/partykick/domains/partykick.nl/public_html/admin.php on line 205

Warning: move_uploaded_file(foto/): failed to open stream: Is a directory in /home/partykick/domains/partykick.nl/public_html/admin.php on line 205

Warning: move_uploaded_file(): Unable to move '/tmp/phpRiUmKC' to 'foto/' in /home/partykick/domains/partykick.nl/public_html/admin.php on line 205
Fout
Notice: Undefined index: 3 in /home/partykick/domains/partykick.nl/public_html/admin.php on line 205

Warning: move_uploaded_file(foto/): failed to open stream: Is a directory in /home/partykick/domains/partykick.nl/public_html/admin.php on line 205

Warning: move_uploaded_file(): Unable to move '/tmp/phprzHXFh' to 'foto/' in /home/partykick/domains/partykick.nl/public_html/admin.php on line 205
Fout


Lijn 205 ==
  1. <?php
  2. if(!move_uploaded_file($_FILES['bestand']['name'][$i],$map.$_FILES['bestand'][$aantalll]))
  3. ?>

0 antwoorden

Gesponsorde links
Er zijn nog geen reacties op dit bericht.
Dit onderwerp is gesloten.
Actieve forumberichten
© 2002-2024 Sitemasters.be - Regels - Laadtijd: 0.216s