<?php
$conn = mysqli_connect("localhost","root","","furniture");
$vehicle= $_POST['vehicle'];
if($_POST["Submit"] == "Submit")
{
    for($i=0; $i<sizeof($vehicle);$i++)
    {
        $query="INSERT INTO events (status) VALUES ('".$vehicle[$i]."')";  mysqli_query($query) or die (mysqli_error());
    }
    echo "updated";
}
?>
<html>
  <body>
    <form action="test.php" method="post">
      <input type="checkbox" name="vehicle" value="Car" checked> I have a car<br>
      <input type="submit" value="Submit">
    </form>
  </body>
</html>
I'm getting this error:
Undefined index: Submit in C
Undefined index: vehicle in C
 
     
     
    