Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $host = "localhost";
- $user = "root";
- $pass = "";
- $banco ="cadastro";
- // Criando a conexão
- $conexao = new mysqli($host, $user, $pass, $banco);
- // checando a conexão
- if ($conexao->connect_error) {
- die("Conexão Falhou: " . $conexao->connect_error);
- }
- $login = $_POST['login'];
- $email = $_POST['email'];
- $senha = $_POST['senha'];
- $senhaconf = $_POST['senhaconf'];
- $pais = $_POST['pais'];
- $telefone = $_POST['telefone'];
- $sql = "INSERT INTO usuarios ('login', 'senha', 'email','senha','pais','telefone')
- VALUES ($login, $email , $senha, $senhaconf, $pais ,$telefone )";
- if ($conexao->query($sql) === TRUE) {
- echo "Inserido com sucesso";
- } else {
- echo "Erro: " . $sql . "<br>" . $conexao->error;
- }
- $conexao->close();
- ?>
Advertisement
Add Comment
Please, Sign In to add comment