move_uploaded_file not uploading PHP

preview_player
Показать описание
I explain all code in this video.
This is how to solve the move upload function in PHP which is not uploading into the destination folder.
Рекомендации по теме
Комментарии
Автор

this is my script, but it is not work. which is the problem :
<?php
require 'config.php';
$msg="";
if(isset($_POST['submit'])){

$p_name =$_POST['pName'];
$p_price =$_POST['pPrice'];

$target_dir ="image/";

move_uploaded_file($_FILES['pImage']["tmp_name"], $target_file);

$sql="INSERT INTO product (product_name, product_price, product_image)VALUES('$p_name', '$p_price', '$target_file')";

if(mysqli_query($conn, $sql)){
$msg="Product Added to the database Successfully!";
}
else{
$msg="Failed to add the product!";
}
}
?>

Setiawan-