Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $ext=array('jpg','gif','mpg','mpeg','png');
- $destpath = "galerije/" ;
- $i=0;
- foreach ($_FILES['file']['name'] as $file)
- {
- $i++;
- if(!empty($file))
- {
- if (!in_array(end(explode(".", strtolower($file['name']))), $ext))
- {
- if(move_uploaded_file($file,$destpath))
- {
- echo "<img src='$destpath$file' style='vertical-align:middle; max-width:100px; max-height:100px; margin-bottom:15px;'> ".$file. "<br/>" ;
- }
- else
- {
- echo "error,check chmod";
- }
- }
- else {
- echo "error!<br />";}
- }
- }
Add Comment
Please, Sign In to add comment