图片上传无法正常工作 - Php

I have this code:

$name="dsds"

    if(isset($_FILES))
        {   
            $imagename = $_FILES['uploadimage'].$name;
            $imagetype = $_FILES['uploadimage'].$type;
            $imagesize = $_FILES['uploadimage'].$size;


            if($imagetype != "image/gif" || $imagetype != "image/jpg" || $imagetype == "image/png" || $imagetype == "image/jpeg")
            {
                $error = 'Please upload an image with JPG, PNG, GIF';
            }
            elseif($imagesize > 716800)
            {
                $error = 'Image Needs to be under 700kb only';      
            }
            else
            {
                         $success = 'Uploaded';
                        }

But sometimes it uploads the image but it adds "Array" to the filename , and sometimes it doesnt work at all.

$imagename = $_FILES['uploadimage']['name'];
$imagetype = $_FILES['uploadimage']['type'];
$imagesize = $_FILES['uploadimage']['size'];

You have to use it like this, name, type and size are not variables but keys

Found your mistake. I think you meant

$imagename = $_FILES['uploadimage']['name'];

and not

$imagename = $_FILES['uploadimage'].$name;