Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <title>Cadastro de Clientes</title>
- <meta charset="utf-8">
- <link rel="stylesheet" href="bootstrap/css/bootstrap.css">
- <link rel="stylesheet" href="bootstrap/css/style.css">
- <script src="bootstrap/js/bootstrap.js"></script>
- </head>
- <body>
- <div align="center" class="banner">
- <img src="img/Banner Giga.jpg">
- <form method="post" action="processa.php">
- <h1>Cadastro de Clientes</h1>
- <label>Nome:</label> <input type="text" class="campo" name="nome" required placeholder="Digite seu Nome:" maxlength="100"/><br><br>
- <label>Telefone:</label> <input type="text" class="campo" name="telefone" placeholder="Digite seu Telefone" maxlength="14"/><br><br>
- <label>Bairro:</label> <input type="text" class="campo" name="bairro" placeholder="Digite o seu Bairro" maxlength="100"/><br><br>
- <label>Rua:</label> <input type="text" class="campo" name="rua" placeholder="Digite sua Rua" maxlength="100"/><br><br>
- <label>Numero:</label> <input type="text" class="campo" name="numero_casa" placeholder="Numero da Casa" maxlength="100"/><br><br>
- <input type="submit" name="submit" value="Salvar" class="btn btn-danger">
- <input type="reset" value="Limpar" class="btn btn-danger">
- </form>
- </body>
- </html>
- <?php
- $hostname= "localhost";
- $user = "root";
- $password = "";
- $database = "gigabyte";
- $conexao = mysqli_connect($hostname,$user,$password,$database);
- mysqli_select_db($conexao,$database);
- if(!$conexao){
- echo "Falha na conexão com o Banco de Dados";
- }
- ?>
- <?php
- include_once("conexao.php");
- $nome = filter_input(INPUT_POST,'nome');
- echo "Nome: $nome <br>";
- $telefone =filter_input(INPUT_POST,'telefone');
- echo "Telefone: $telefone<br>";
- $bairro =filter_input(INPUT_POST,'bairro' );
- echo "Bairro: $bairro<br>";
- $rua =filter_input(INPUT_POST,'rua' );
- echo "Rua: $rua<br>";
- $numero =filter_input(INPUT_POST,'numero_casa');
- echo "Numero: $numero<br>";
- $result="INSERT INTO clientes (nome,telefone,bairro,rua,numero_casa) VALUES('',$nome', '$telefone', '$bairro', '$rua', '$numero'))";
- $resultado= mysqli_query($conexao, $result);
- if($result == true){
- echo "Cadastrado com Sucesso!";
- }else{
- echo "Opa, Algo de errado não está certo";
- }
- ?>
Add Comment
Please, Sign In to add comment