multiple uploads

0

Hello everyone, I'm developing a website, but I'm still a little lay and a friend of mine was helping me, but now I can not help him.

Well my doubt is the following how do I upload more than one image because this system he set up for me to upload one and one image, and that would take a lot for the client.

Code php:

<form method="post" style="margin-left: 400px;" enctype="multipart/form-data">
    <div id="queue"></div>
    <input name="imagem" type="file">
    <input type="submit" name="up" value="upado">
</form>
<?php 
    if (isset($_POST['up']) && $_POST['up'] == "upado") {
        if (count($_FILES) > 0) {
            $img = $_FILES['imagem'];
            $ff = md5(sha1($img['name'])).".jpg";
            if (move_uploaded_file($img['tmp_name'], "../fotos/".$ff)) {
                $sql  = "insert into imoveis_fotos (foto_imovel,foto_nome)";
                $sql .=" values ({$imv_id},'{$ff}')";
                mysql_query($sql);

                header("refresh:1;url=?pag=imoveis_fotos&id=".$imv_id);
            }
        }
    }
?>
    
asked by anonymous 25.04.2017 / 18:07

0 answers