<?php
include("db.php");
if(isset($_POST['submit'])){
$result = mysqli_query($conn, "INSERT INTO cars(car)VALUES('$_POST[car]')");

header('Location: car-list.php');
}

?>

<!DOCTYPE html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, shrink-to-fit=no">
    <title>Driver Logbook</title>
    <link rel="stylesheet" href="assets/bootstrap/css/bootstrap.min.css">
    <link rel="stylesheet" href="assets/fonts/font-awesome.min.css">
    <link rel="stylesheet" href="assets/css/Login-Form-Clean.css">
    <link rel="stylesheet" href="assets/css/Login-Form-Dark.css">
    <link rel="stylesheet" href="assets/css/Registration-Form-with-Photo.css">
    <link rel="stylesheet" href="assets/css/styles.css">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script></head>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
</head>


<div class="container" style=" max-width:1000px; width:90%; margin:auto; border-radius:20px;">
<div style="margin-top:10%;"class="panel panel-default">


      <div class="well text-center"><h1> Add Car</h1></div>


<div class="panel-body">
  <form action="add-car.php" method="post">
    <div class="form-group">
    <label style="font-size:18px">Car Name and Registration<label>
      <input style="margin-left:18%; width:420px;"type="text" name="car" id="name" class="form-control" required>
    </div>

    <div class="form-group">
      <input type="submit" name="submit" value="submit" class="btn btn-primary" required>
    </div>
  </form>

</div>

</div>
</div>
