<html>
    <head>
    <!-- Meta tags Obrigat贸rias -->
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <!-- Bootstrap CSS -->
    <link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">

    <title>DADOS</title>
  </head>
<body>
<form action="#" method="post">
<table class='table table-bordered' style='width: 75%; margin-left: auto; margin-right: auto;'>
    <thead>
<tr>
<th scope='col'>LOGIN</th>
<th scope='col'>NOME</th>
<th scope='col'>SERIE</th>
<th scope='col'>TURMA</th>
<th scope='col'>TURNO</th>
<th scope='col'>MATRICULA</th>
<th scope='col'>SALA</th>
</tr>
</thead>
<tr>    
<td>
<input type="text" name="login" id="login"/></td>  
<td>
<input type="text" name="nome_aluno"/></td> 
<td>
<select id="serie" name="serie">
  <option value="infantil 2">INFANTIL 2</option>
  <option value="infantil 3">INFANTIL 3</option>
  <option value="infantil 4">INFANTIL 4</option>
  <option value="infantil 5">INFANTIL 5</option>
</select></td>
<td>
<select id="turma" name="turma">
  <option value="A">A</option>
  <option value="B">B</option>
  <option value="C">C</option>
  <option value="D">D</option>
</select></td>
<td>
<select id="turno" name="turno">
  <option value="matutino">MATUTINO</option>
  <option value="vespertino">VESPERTINO</option>
</select></td>
<td>
<input type="text" name="matricula"/></td>
<td>
<select id="sala" name="sala">
  <option value="1">1</option>
  <option value="2">2</option>
  <option value="3">3</option>
  <option value="4">4</option>
  <option value="5">5</option>
  <option value="6">6</option>
  <option value="7">7</option>
</select></td>
<td><input type="submit" value="Cadastrar"/></td>
</form>
</tbody>
 </table>

    <script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
    <script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
  </body>
</html>
<?php
$login = $_POST['login'];
$nome_aluno = $_POST['nome_aluno'];
$serie = $_POST['serie'];
$turma = $_POST['turma'];
$turno = $_POST['turno'];
$matricula = $_POST['matricula'];
$sala = $_POST['sala'];


$servername = "localhost";
$database = "kaltekgo_avila_cftv";
$username = "kaltekgo_admin";
$password = "2d!JxAGI+1c7a1";
// Create connection
$conn = mysqli_connect($servername, $username, $password, $database);
// Check connection
if (!$conn) {
      die("Connection failed: " . mysqli_connect_error());
}
 
echo "Connected successfully";
 
//$sql = "INSERT INTO cftv (login, nome_aluno, serie, turma, turno, matricula, sala) VALUES ('$login','$nome_aluno','$serie','$turma','$turno','$matricula','$sala')";
if (mysqli_query($conn, $sql)) {
      echo "New record created successfully";
} else {
      echo "Error: " . $sql . "<br>" . mysqli_error($conn);
}
mysqli_close($conn);
?>