Don't like ads? PRO users don't see any ads ;-)
Guest

php uploader with name change

By: a guest on Aug 22nd, 2012  |  syntax: PHP  |  size: 0.33 KB  |  hits: 11  |  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. <?
  2. if (isset ($_FILES['files']))
  3. {
  4.     $_FILES['files'];
  5.     foreach ($_FILES['files']['tmp_name'] as $key => $tmp_name){
  6.         $tmp_name = $_FILES['files']['tmp_name'][$key];
  7.         $ran = rand(1,2); // instead of 2 put a the limit of the images ****** HERE
  8.         move_uploaded_file($tmp_name, "./images/$ran.jpg");}
  9. }
  10. ?>