<?php
include('../includes/connection.php');
$name=$_POST['name'];
$filename=$_FILES['image']['name'];
$tempname=$_FILES['image']['tmp_name'];
$status=$_POST['status'];

$folder="images/".$filename;

$sql="insert into category_add(name,image,status) values('$name','$folder','$status')";
$result=mysqli_query($con,$sql);
if($result)
    
{
    move_uploaded_file($tempname,$folder);
    echo"<script>alert('successful');;window.location.href='category.php'</script>";
}
else{
    echo"<script>alert('not successful');window.location.href='category.php'</script>";
}
?>
