I am using following code for uploading multiple files. i don't know whether this code is right or wrong because some of my users are getting syntax error in this page. So, i want to check this code. please help me.
<?php
if(!empty($_FILES['MyPhoto']['name'])){
$Photos=$_FILES['MyPhoto']['name'];
$valid_formats = array("jpeg", "jpg", "png");
$Vars=array("A","B","C","D");
$PicsArray=array();
$x="0";
$y="0";
$Id="some_variable";
foreach($Photos as $Pics){
$PicType= pathinfo($Pics, PATHINFO_EXTENSION);
if(in_array($PicType, $valid_formats)) {
$PicName=$Id.$Vars[$y];
$tmpFilePath = $_FILES['MyPhoto']['tmp_name'][$x];
$newFilePath = "./MyPics/" .$PicName.".".$PicType;
$newFilePath1 = "./Admin/MyPics/" .$PicName.".".$PicType;
$newFilePath2 = "./Admin/NewPics/" .$PicName.".".$PicType;
if(move_uploaded_file($tmpFilePath, $newFilePath)) {
copy($newFilePath, $newFilePath1);
copy($newFilePath, $newFilePath2);
}
$y++;
}
$x++;
}
}
?>
i have tested in http://phpfiddle.org/. it is showing following error:
You input disabled function(s) by PhpFiddle : move_uploaded_file($tmpFilePath, $newFilePath)), copy($newFilePath, $newFilePath1), copy($newFilePath, $newFilePath2)