<?php
$cantidad= count($_FILES["txtImg"]["tmp_name"]);
for ($i=0; $i<$cantidad; $i++){
//Comprobamos si el fichero es una imagen
$fecha = date("d-m-Y");
if ($_FILES['txtImg']['type'][$i]=='image/png' || $_FILES['txtImg']['type'][$i]=='image/jpeg'){
//Subimos el fichero al servidor
$origen = $_FILES["txtImg"]["tmp_name"][$i];
$destino = 'img/send/image-'.rand(0,100).$fecha.$_FILES["txtImg"]["name"][$i];
move_uploaded_file($origen,$destino);
}
}
?>
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.