我无法使用$ _POST将数据插入到MySQL中

时间:2019-05-27 12:11:48

标签: php

提交表单时,文件名的输入描述在数据库中始终为空白,但是文件的输入成功添加

<form action="connect.php" method="post" enctype="multipart/form-data">
    File name:<br />
    <input type="text" name="filename" /><br/><br/>
    Description:<br />
    <input type="text" name="description" />
    <br /><br />
    <input type="file" id="files" name="file" />
if(isset($_POST['submit']))
{

    $blobObj->insertBlob($_FILES['file']['tmp_name'],"application/pdf");
    $name = $_POST['filename'];
    $description = $_POST['description'];
    if($name !=''||$description !=''){
    $sql1 = "INSERT INTO files (filename, description) VALUES 
 ('$name','$description')";
     include('disp_quiz.html'); 
    }
    else{
    echo "<script> alert ('Some Fields are Blank') </script>";
    }
}

0 个答案:

没有答案