通过PHP上传表单文件

(beginner)

I'm having trouble uploading my file. I see the filename being posted to the database, but the file is not being posted to the images folder. It seems as though nothing is happening. Here is my following code, please advise me what I need to change:

<?php
//the $art variable gets posted to a database eventually
    $art = mysql_real_escape_string(stripslashes($_FILES["art"]["name"]));
$art_ext = pathinfo($art, PATHINFO_EXTENSION);
$art = md5($art).".".$art_ext;
if($art!=""){
    move_uploaded_file($art, "images/".$art );
}
?>
<script type="text/javascript">
$(function(){
    image_upload = {
        UpdatePreview: function(obj){
          // if IE < 10 doesn't support FileReader
          if(!window.FileReader){
             // don't know how to proceed to assign src to image tag
          } else {
             var reader = new FileReader();
             var target = null;

             reader.onload = function(e) {
              target =  e.target || e.srcElement;
               $("#imageupload").attr("src", target.result);
             };
              reader.readAsDataURL(obj.files[0]);
          }
        }
    };
});
    </script>
    <form action="new.php" method="post" enctype="multipart/form-data">
<input type='file' name='art' id="file" onchange='image_upload.UpdatePreview(this)' value="Upload"  accept="image/gif,image/jpeg,image/png"/>
        </p>
        <p>upload a image! (.gif, .jpg, .png formats allowed. 5MB max)</p>
        <img id="imageupload" src="1x1.png" alt="test" />
<input type="submit" class="smallbtn4" style="cursor:pointer;" value="post"/>
</form>

Here's the format for move_uploaded_file():

$path = 'images/';
move_uploaded_file($_FILES['art']['tmp_name'], $path.basename($_FILES['art']['name']));

when using move_uploaded_files() your destination path should also include the name of the file....right now your destination path is:

images/

it should be:

images/nameOfImg.ext

Hope this helps!

EDIT:

After seeing the comment by @enhzflep, you should also hash the name of the file and create your filename string before using it in move_uploaded_file();