Warning: move_uploaded_file(): The second argument to copy() function cannot be a directory in /Applications/XAMPP/xamppfiles/htdocs/wincycle/admin/edit_product2.php on line 25
Warning: move_uploaded_file(): Unable to move '/Applications/XAMPP/xamppfiles/temp/phpKlNTnb' to '../images/product/' in /Applications/XAMPP/xamppfiles/htdocs/wincycle/admin/edit_product2.php on line 25
Code (PHP)
<?php include 'function.inc.php'; ?>
<meta charset="UTF-8">
<?php
$photoname='';
if ($_FILES["fileupload"]["tmp_name"]!="") {
$fname=explode(".",$_FILES["fileupload"]["name"]);
$photoname=$_POST['pro_img'];
move_uploaded_file($_FILES["fileupload"]["tmp_name"],"../images/product/".$photoname);
}
$accessory1='';
if ($_FILES["accessory1"]["tmp_name"]!="") {
$fname=explode(".",$_FILES["accessory1"]["name"]);
$photoname=$_POST['a1'];
move_uploaded_file($_FILES["accessory1"]["tmp_name"],"../images/product/".$photoname);
}
$accessory2='';
if ($_FILES["accessory2"]["tmp_name"]!="") {
$fname=explode(".",$_FILES["accessory2"]["name"]);
$photoname=$_POST['a2'];
move_uploaded_file($_FILES["accessory2"]["tmp_name"],"../images/product/".$photoname);
}
$accessory3='';
if ($_FILES["accessory3"]["tmp_name"]!="") {
$fname=explode(".",$_FILES["accessory3"]["name"]);
$photoname=$_POST['a3'];
move_uploaded_file($_FILES["accessory3"]["tmp_name"],"../images/product/".$photoname);
}
$accessory4='';
if ($_FILES["accessory4"]["tmp_name"]!="") {
$fname=explode(".",$_FILES["accessory4"]["name"]);
$photoname=$_POST['a4'];
move_uploaded_file($_FILES["accessory4"]["tmp_name"],"../images/product/".$photoname);
}
$accessory5='';
if ($_FILES["accessory5"]["tmp_name"]!="") {
$fname=explode(".",$_FILES["accessory5"]["name"]);
$photoname=$_POST['a5'];
move_uploaded_file($_FILES["accessory5"]["tmp_name"],"../images/product/".$photoname);
}
$accessory6='';
if ($_FILES["accessory6"]["tmp_name"]!="") {
$fname=explode(".",$_FILES["accessory6"]["name"]);
$photoname=$_POST['a6'];
move_uploaded_file($_FILES["accessory6"]["tmp_name"],"../images/product/".$photoname);
}
$query = sprintf(
'update product set type_id=%s, pro_name="%s", pro_detail="%s",'.$photoname.'="%s", pro_color="%s", pro_color2="%s",id_cat=%s,size="%s",'.$accessory1.'="%s",'.$accessory2.'="%s",'.$accessory3.'="%s"'
. ','.$accessory4.'="%s",'.$accessory5.'="%s",'.$accessory6.'="%s" where pro_no="%s"',
s($con,$_POST['type_id']),
s($con,$_POST['pro_name']),
s($con,$_POST['pro_detail']),
$photoname,
s($con,$_POST['pro_color']),
s($con,$_POST['pro_color2']),
s($con,$_POST['id_cat']),
s($con,$_POST['size']),
$accessory1,
$accessory2,
$accessory3,
$accessory4,
$accessory5,
$accessory6,
s($con,$_POST['id_edit'])
);
$result = mysqli_query($con,$query);
msgbox('บันทึกข้อมูลเรียบร้อย','product.php');
?>