Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Mar 8th, 2012  |  syntax: PHP  |  size: 0.99 KB  |  hits: 81  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <html>
  2.  
  3. <head>
  4.   <title>bele</title>
  5. </head>
  6.  
  7. <body>
  8. <?php
  9.  
  10.  
  11.  if(empty($_GET['Nfiles']))$Nfiles=30;else $Nfiles=$_GET['Nfiles'];
  12. if($_FILES['userfile']['tmp_name'][0]!=''){
  13.         for($i=0;$i<$Nfiles&&$_FILES['userfile']['tmp_name'][$i]!='';$i++){
  14.         $uploaddir = dirname(__FILE__);//'/var/www/uploads/';
  15.         $uploadfile = $uploaddir .'/'. basename($_FILES['userfile']['name'][$i]);
  16.         print "<pre>";
  17.         if (move_uploaded_file($_FILES['userfile']['tmp_name'][$i], $uploadfile)) {
  18.            print "File is valid, and was successfully uploaded. ";
  19.            //print_r($_FILES);
  20.         } else {
  21.            print "Possible fie upload attack!  Here's some debugging info:\n";
  22.            //print_r($_FILES);
  23.         }
  24.         print "</pre>";
  25.         }
  26. }
  27. ?>
  28. <form action="<?php echo $_SERVER['PHP_SELF'].'?Nfiles='.$Nfiles; ?>" method="post" enctype="multipart/form-data">
  29.   Send beleberda:<br>
  30.   <?php for($i=0;$i<$Nfiles;$i++){echo '<input name="userfile[]" type="file"><br>';}?>
  31.   <input type="submit" value="Send files">
  32. </form>
  33.  
  34. </body>
  35.  
  36. </html>