【发布时间】:2023-03-08 11:49:01
【问题描述】:
我正在引导程序中执行我的项目。里面有图片上传的选项,但是我不能把它上传到我的数据库中。
boot.html:
<div class="form-group">
<label class="col-md-4 control-label" for="imgu">Upload images if / any</label>
<div class="col-md-4">
<input id="file" name="file" class="input-file" type="file">
</div>
php 文件:
<?php
$a=$_POST['cname'];
$b=$_POST['subject'];
$c=$_POST['cat'];
$d=$_POST['cmp'];
$e=$_POST['cweb'];
move_uploaded_file($_FILES["file"]["tmp_name"],$_FILES["file"]["name"]);
$x=$_FILES["file"]["name"];
mysql_connect("localhost","root","");
mysql_select_db("com");
$sql=mysql_query("insert into cd values('$a','$b','$c','$d','$e','$x')");
if(!$sql)
{
echo "not Inserted";
}
else
{
header("location:home.php");
}
?>
如果此代码有任何错误,请帮助我
【问题讨论】:
标签: php forms twitter-bootstrap