图片上传失败是怎么回事啊?大家帮忙看看,下面代码,是我move_uploaded_file() 函数里边参数写错了吗? 5
那个参数应该怎么写?$cat_id=$_POST['cat_id'];$p_name=$_POST['p_name'];$p_price=$_POST['p_price'...
那个参数应该怎么写?
$cat_id=$_POST['cat_id'];
$p_name=$_POST['p_name'];
$p_price=$_POST['p_price'];
$p_intro=$_POST['p_intro'];
$upfile=$_FILES['ufile'];
$name = $upfile['name'];
$type = $upfile['type'];
$size = $upfile['size'];
$tmp_name = $upfile['tmp_name'];
$error = $upfile['error'];
$src=$_SERVER['DOCUMENT_ROOT'];
if($_FILES["ufile"]["error"] > 0){
echo "Return Code: " . $_FILES["ufile"]["error"] . "<br />";
}else{
$dizhi=move_uploaded_file($tmp_name, $src."/sujiao/admin/upload");
}
$sql="insert into product values(null,$cat_id,'$p_name','$p_intro','$p_price','$dizhi')";
mysql_query($sql); 展开
$cat_id=$_POST['cat_id'];
$p_name=$_POST['p_name'];
$p_price=$_POST['p_price'];
$p_intro=$_POST['p_intro'];
$upfile=$_FILES['ufile'];
$name = $upfile['name'];
$type = $upfile['type'];
$size = $upfile['size'];
$tmp_name = $upfile['tmp_name'];
$error = $upfile['error'];
$src=$_SERVER['DOCUMENT_ROOT'];
if($_FILES["ufile"]["error"] > 0){
echo "Return Code: " . $_FILES["ufile"]["error"] . "<br />";
}else{
$dizhi=move_uploaded_file($tmp_name, $src."/sujiao/admin/upload");
}
$sql="insert into product values(null,$cat_id,'$p_name','$p_intro','$p_price','$dizhi')";
mysql_query($sql); 展开
1个回答
2011-07-04
展开全部
光是看看就晕了
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询