move_uploaded_file()正好需要2个参数,给出1

<?php

include("mysqlconnect.php");

function GetImageExtension($imagetype)
{
    if(empty($imagetype)) return false;

    switch($imagetype)
    {
        case 'image/bmp': return '.bmp';
        case 'image/gif': return '.gif';
        case 'image/jpeg': return '.jpg';
        case 'image/png': return '.png';
        default: return false;
     }
}



if (!empty($_FILES["uploadedimage"]["name"])) {

    $file_name=$_FILES["uploadedimage"]["name"];
    $temp_name=$_FILES["uploadedimage"]["tmp_name"];
    $imgtype=$_FILES["uploadedimage"]["type"];
    $ext= GetImageExtension($imgtype);
    $imagename=date("d-m-Y")."-".time().$ext;
    $target_path = "img/".$imagename;


    if(move_uploaded_file($temp_name)) {

        $query_upload="INSERT INTO test_image ('id' ,'image', 'image_path',     'submission_date') VALUES ('".$target_path."','".date("Y-m-d")."')";

        mysqli_query($query_upload) or die("error in $query_upload == ----> ".mysqli_error());  

    }else{

        exit("Error While uploading image on the server");
    } 

}

?>

Warning: move_uploaded_file() expects exactly 2 parameters, 1 given in /home/u957762221/public_html/saveimage.php on line 29

This code throws an Error when attempting to upload an image to the server

move_uploaded_file(string $filename, string $destination)

This function needs second parameter as destination (where to upload file). You just gave one parameter ($temp_name, which is file name). I see something similar to destination in your code, so try this instead:

if(move_uploaded_file($temp_name, $target_path)) {

First, you may not really need that GetImageExtension() Function. PHP's pathinfo() would do just fine in getting the Extension for You. Anyways; below would be the right syntax for move_uploaded_file($filename, $destination), which accepts 2 parameters: 1st the File-Name (from the $_FILES Global) and the Destination (The Path to where you wish to save the File - including File-Name, though.

<?php

    include("mysqlconnect.php");


    if (!empty($_FILES["uploadedimage"]["name"])) { 
        $file_name      = $_FILES["uploadedimage"]["name"];
        $temp_name      = $_FILES["uploadedimage"]["tmp_name"];
        $imgtype        = $_FILES["uploadedimage"]["type"];
        $ext            = pathinfo($file_name, PATHINFO_EXTENSION); 
        $imagename      = date("d-m-Y") . "-" . time() . "." . $ext;
        $target_path    = "img/".$imagename;

        // YOU JUST FORGOT THE DESTINATION: $target_path ;-)
        if(move_uploaded_file($temp_name, $target_path)) {  
            // HERE WE USED THE IMAGE-TYPE/EXT. AS THE VALUE FOR THE TABLE-COLUMN: `image`
            // IT IS UP TO YOU TO SUBSTITUTE THE RIGHT VALUES THERE...  
            $query_upload   = "INSERT INTO test_image ('image', 'image_path', 'submission_date') VALUES ";
            $query_upload  .= "('" . $ext . "', " . $target_path . "', '".date("Y-m-d")."' )";


            mysqli_query($query_upload) or die("error in $query_upload == ----> ".mysqli_error());

        }else{      
            exit("Error While uploading image on the server");
        }

    }

It is mandatory to pass two arguments for the move_upload_file() other wise it will be pointing out the error while upload.

Arg:1 file - Required. Specifies the file to be moved

Arg:2 newloc - Required. Specifies the new location for the file

move_uploaded_file() - This will upload the file to the server where we point out in the target path so that the retrieval of the images are found to be easy and the images display is done with the help of the uploaded pictures alone.

The move_uploaded_file() function moves an uploaded file to a new location.

This function returns TRUE on success, or FALSE on failure.

Syntax: move_uploaded_file($filename, $filepath);

Where

$filename: $_FILES["file"]["tmp_name"];

$filepath:  is the folder where you need to upload the images.

mysqli_query($conn,$query_upload) - It needs two parameters one is the connection variable and the other one is to process with the query.

Here

$conn- Connection variable for the DB
$query_upload - It is the query to be executed.

Replace your code with the below one.

<?php
if(move_uploaded_file($temp_name,$target_path)) {

$query_upload="INSERT INTO test_image ('image', 'image_path', 'submission_date') VALUES ('".$target_path."','".date("Y-m-d")."')";

mysqli_query($conn,$query_upload) or die("error in $query_upload == ----> ".mysqli_error());  

}else{

   exit("Error While uploading image on the server");
} 
}
?>