我正在用PHP上传一个图像,但它没有上传到文件夹?

我正在用PHP上传一个图像,但它没有上传到文件夹?,php,Php,我已经检查了php.ini文件上传是否打开。 下面是代码,请帮助我。 文件未上载到文件夹图像中。 我不知道代码有什么问题。 问题不在查询中,因为(!empty($\u FILES[“uploadedimage”][“name”])不会上载图像 <form enctype="multipart/form-data" method="post"> <th><input style=" width:

我已经检查了php.ini文件上传是否打开。 下面是代码,请帮助我。 文件未上载到文件夹图像中。 我不知道代码有什么问题。 问题不在查询中,因为(!empty($\u FILES[“uploadedimage”][“name”])不会上载图像

<form enctype="multipart/form-data" method="post">
                                     <th><input style=" width:100px; font-size:13px" name="op"  Placeholder="Operator Name"/></th>
 <th>  <input class="file-upload-input" type="file" name="uploadedimage"></th>

<th> <input class="btn btn-danger" type="submit" name="uploadnow" value="SUBMIT" class="theme-btn btn-style-one"></th>


                                    </tr></form>
                                <?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 = "images/".$imagename;    
if($_POST['uploadnow'])
{
$op=$_POST['op'];
if(move_uploaded_file($temp_name, $target_path)) {
    $sql="INSERT INTO operator(op,mono) VALUES('".$op."','".$target_path."') ";
    mysql_query($sql) or die
    ("error in $query_upload == ----> ".mysql_error());  
    }
}

?> <script type="text/javascript">
document.location.href='operator.php';
</script>
<?php

}
?>

尝试使用$target_path=“/images/”$imagename

尝试将这些行放在代码的顶部,以显示所有PHP错误/警告,并查看得到的结果

error_reporting(E_ALL);
ini_set('display_errors', 1);

数据是否保存在数据库中?您的代码似乎正确..请检查文件夹权限。我检查了,但不起作用,请重新检查代码。代码看起来合法,请尝试调试。如果(!empty($_FILES[“uploadedimage”][“name”]),请尝试回显“join”(加入){