<?php 
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
error_reporting(E_ALL);

$db = new SQLite3('./api/.ltq_db.db');

if(isset($_POST['submit'])){
$db->exec("INSERT INTO dns(title, url) VALUES('".$_POST['title']."', '".$_POST['url']."')");
$db->close();

header("Location: dns.php");
}
include ('header.php');
?>

         <div class="container" style="padding:10px;">
            <div class="col-md-10 px-4">
              <div class="card bg-dark text-white">
                <div class="card-header card-header-warning">
                  <h4 class="card-title">Add DNS</h4>
                </div>
                <div class="card-body">
                  <form  method="post">
                      <div>
                        <div class="form-group">
                          <label class="bmd-label-floating">Title</label>
                          <input type="text" class="form-control" name="title">
                        </div>
                      </div>
                      <div>
                        <div class="form-group">
                          <label class="bmd-label-floating">DNS</label>
                          <input type="text" class="form-control" name="url">
                        </div>
                      </div>
                      <div>
					<br><button type="submit" name="submit" class="btn btn-warning pull-right">Submit</button>
				</form>
				</div>
              </div>
            </div>
          </div>
    <br><br><br>
<?php include ('footer.php');?>
</body>

</html>