Guest User

Untitled

a guest
May 22nd, 2018
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.53 KB | None | 0 0
  1. $ext=array('jpg','gif','mpg','mpeg','png');
  2.     $destpath = "galerije/" ;
  3.    
  4.     $i=0;
  5. foreach ($_FILES['file']['name'] as $file)
  6. {
  7.     $i++;
  8.   if(!empty($file))
  9.   {
  10.     if (!in_array(end(explode(".", strtolower($file['name']))), $ext))
  11.         {
  12.             if(move_uploaded_file($file,$destpath))
  13.             {
  14.               echo "<img src='$destpath$file' style='vertical-align:middle; max-width:100px; max-height:100px; margin-bottom:15px;'> ".$file. "<br/>" ;
  15.             }
  16.             else
  17.             {
  18.                 echo "error,check chmod";
  19.             }
  20.         }
  21.        
  22.         else {
  23.         echo "error!<br />";}
  24.    
  25.     }
  26. }
Add Comment
Please, Sign In to add comment