Salve ragazzi, ho creato una pagina upload che puo' vederla solo l'ammnistratore, con un form dove caricare la foto. come posso modificare questo formo in modo da poter caricare piu foto insieme.
codice form:
<form action="uploadck.php" enctype="multipart/form-data" method="POST">
<p>Cerca il file:</p>
<p><input name="file_up" type="file" /></p>
<p><input type="submit" value="Invia File" /></p>
</form>
----------------------------
questo e il codice php
<?Php
$file_upload="true";
$file_up_size=$_FILES['file_up'][size];[/size]
echo $_FILES[file_up][name];
if ($_FILES[file_up][size]>2500000){$msg=$msg."Your uploaded file size is more than 2500KB[/size]
so please reduce the file size and then upload.<BR>";
$file_upload="false";}
if (!($_FILES[file_up][type] =="image/jpeg" OR $_FILES[file_up][type] =="image/gif"))
{$msg=$msg."Your uploaded file must be of JPG or GIF. Other file types are not allowed<BR>";
$file_upload="false";}
$file_name=$_FILES[file_up][name];
$add="photos/$file_name"; // the path with the file name where the file will be stored
if($file_upload=="true"){
if(move_uploaded_file ($_FILES[file_up][tmp_name], $add)){
// do your coding here to give a thanks message or any other thing.
}else{echo "Failed to upload file Contact Site admin to fix the problem";}
}else{
echo $msg;
}
?>