Image not being uploaded to the target file using php

Viewed 21
 $image=function($imgTp) //: Anonymous function
     {
        $ret=rand('2000001','4000000');
        $rnam=$_FILES['image']['name'];
        $d=date("Y-m-d");
        $path="uploads/";//folder name is users
        $img=$_FILES['image']['tmp_name'];//upimage is image field
        $name="upload$d$ret$rnam";
        $filename=move_uploaded_file($img,$path.$name);
        $pathname="$path$name";
        if($pathname)
        {
            return $pathname;
        }
        else
        {
           return "";
        }
    };

trying to use this code to recive image data from a form . unfortunately the images are not being uploaded to the target file .can someone please help me with this

0 Answers
Related