I have a form(Insert new post here) where I am trying to post the entered values to the localhost. I couldn't see my values entered in my local host. I am getting the following error: "Error in response to storage.get: Syntax Error: Unexpected token at Object.callback". To resolve it I have cleared the browser cache and application cache but cannot resolve.
I have added the following debug int the PHP code but this is not reflecting:
echo "<script>alert('Product has been inserted')</script>";
PHP Code:
<?php
if(isset($POST['insert_post'])){
//getting the text data from fields
$product_title = $_POST['product_title'];
$product_cat = $_POST['product_cat'];
$product_brand = $_POST['product_brand'];
$product_price = $_POST['product_price'];
$product_desc = $_POST['product_desc'];
$product_keywords = $_POST['product_keywords'];
//getting the image from the fields
$product_image = $_FILES['product_image']['name'];
$product_image_tmp = $_FILES['product_image']['tmp_name'];
//uploading an image
move_uploaded_file
($product_image_tmp,"product_images/$product_image");
echo $insert_product="insert into products
(product_cat,
product_brand,
product_title,
product_price,
product_desc,
product_image,
product_keywords)
values
(
'$product_cat',
'$product_brand',
'$product_title',
'$product_price',
'$product_desc',
'$product_image',
'$product_keywords'
)";
$insert_pro = mysqli_query($con,$insert_product);
if($insert_pro){
echo "<script>alert('Product has been inserted')</script>";
echo "<script>window('insert_product.php','_self')</script>";}
}
?>
I expect to get an alert as "Product has been inserted" but at present I am not getting it. Once I get it the inserted data will be saved to the local host.[entered_value_in_the_form]