Erro com INSERT + senha sha1
Olá, faz um bom tempo que nao utilizo php e agora vem pedindo para utilizar mysqli, ate entao tudo bem, tenho lido e efetuado algumas mudanças, só que ao fazer este insert, a tela fica em branco, vai para o action do form, porem nao cadastra nada no banco e nao da erro tambem, se alguem puder me ajudar.
<form action="../actions/cadastra-cliente.php" method="post" name="formBriefing" id="cadastro">
<div id="box_dominio">
<input type="radio" name="nivel" value="1" checked="checked" /> Quero anunciar meu carro. ( Anúncio Particular ) <br><br>
<input type="radio" name="nivel" value="2" /> Possuo uma revendedora e quero anúnciar meus veículos.
</div> <!--end box_dominio--> <br>
<fieldset>
<legend>Dados Pessoais</legend>
<label class="tituloCampos">Nome *</label>
<input type="text" class="camposCadastro" name="nome" id="nome" required> <br>
<label class="tituloCampos">Telefone*</label>
<input type="text" class="camposCadastroMin" id="telefone" name="telefone" required> <br>
<label class="tituloCampos">Celular</label>
<input type="text" class="camposCadastroMin" id="celular" name="celular" required> <br>
<label class="tituloCampos">Endereço*</label>
<input type="text" class="camposCadastroMin" id="endereco" name="endereco" required> <br>
<label class="tituloCampos">Número*</label>
<input type="text" class="camposCadastroMin" id="numero" name="numero" required> <br>
<label class="tituloCampos">Complemento</label>
<input type="text" class="camposCadastroMin" id="complemento" name="complemento"> <br>
<label class="tituloCampos">Bairro*</label>
<input type="text" class="camposCadastroMin" id="bairro" name="bairro" required> <br>
<label class="tituloCampos">CEP*</label>
<input type="text" class="camposCadastroMin" id="cep" name="cep" required> <br>
<label class="tituloCampos">Estado*</label>
<select name="estados" id="estados" name="estados" class="camposCadastroMin" required>
</select> <br>
<label class="tituloCampos">Cidade*</label>
<select name="cidades" id="cidades" name="cidades" class="camposCadastroMin" required>
</select><br />
<label class="tituloCampos">Data de Nasc*</label>
<input type="text" class="camposCadastroMin" id="nascimento" name="nascimento" required> <br>
<label class="tituloCampos">RG*</label>
<input type="text" class="camposCadastroMin" id="rg" name="rg" required> <br>
<label class="tituloCampos">E-mail*</label>
<input type="text" class="camposCadastroMin" id="email1" name="email1" required> <br>
<label class="tituloCampos">Confirmar e-mail*</label>
<input type="text" class="camposCadastroMin" id="email2" name="email2" required> <br>
<label class="tituloCampos">Senha*</label>
<input type="password" class="camposCadastroMin" id="senha1" name="senha1" required> <br>
<label class="tituloCampos">Confirmar senha*</label>
<input type="password" class="camposCadastroMin" id="senha2" name="senha2" required> <br>
</fieldset>
<br>
<input type="submit" id="enviarCadastro" name="cadastrar" value="Cadastrar">
</form>
<?php
$conexao = mysqli_connect('localhost', 'root', '', 'guiadoscarros') or die(mysql_error());
if(!empty($_POST)){
$nome = $_POST['nome'];
$email = $_POST['email1'];
$senha = sha1($_POST['senha1']);
$telefone = $_POST['telefone'];
$celular = $_POST['celular'];
$endereco = $_POST['endereco'];
$numero = $_POST['numero'];
$complemento= $_POST['complemento'];
$bairro = $_POST['bairro'];
$cep = $_POST['cep'];
$estado = $_POST['estados'];
$cidade = $_POST['cidades'];
$nascimento = $_POST['nascimento'];
$rg = $_POST['rg'];
$nivel = $_POST['nivel'];
$ativo = '2';
$insere = mysqli_query($conexao, "INSERT INTO usuarios (nome, email1, senha1, telefone, celular, endereco, numero, complemento, bairro, cep, estados, cidades, nascimento, rg, nivel, ativo) VALUES ('$nome','$email', '$senha', '$telefone', '$celular', '$endereco', '$numero', '$complemento', '$bairro', '$cep', '$estado', '$cidade', '$nascimento', '$rg', '$nivel', '$ativo'") or die(mysql_error());
mysqli_close($conexao);
/fim variaveis/
}else{
echo "erro";
}
?>
-- phpMyAdmin SQL Dump
-- version 4.1.14
-- http://www.phpmyadmin.net
--
-- Host: 127.0.0.1
-- Generation Time: 02-Jul-2014 às 19:52
-- Versão do servidor: 5.6.17
-- PHP Version: 5.5.12
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
--
-- Database: guiadoscarros
--
-- --------------------------------------------------------
--
-- Estrutura da tabela usuarios
--
CREATE TABLE IF NOT EXISTS `usuarios` (
`id` int(11) unsigned NOT NULL AUTO_INCREMENT,
`nome` varchar(50) NOT NULL,
`email` varchar(25) NOT NULL,
`senha` varchar(40) NOT NULL,
`telefone` varchar(35) NOT NULL,
`celular` varchar(35) NOT NULL,
`endereco` varchar(250) NOT NULL,
`numero` int(10) NOT NULL,
`complemento` varchar(250) NOT NULL,
`bairro` varchar(150) NOT NULL,
`cep` int(30) NOT NULL,
`estado` varchar(5) NOT NULL,
`cidade` varchar(250) NOT NULL,
`nascimento` varchar(30) NOT NULL,
`rg` varchar(20) NOT NULL,
`tipo` varchar(30) NOT NULL,
`nivel` int(1) unsigned NOT NULL DEFAULT '1',
`ativo` tinyint(1) NOT NULL DEFAULT '1',
`cadastro` datetime NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `usuario` (`email`),
KEY `nivel` (`nivel`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
--
-- Extraindo dados da tabela usuarios
--
INSERT INTO usuarios (id, nome, email, senha, telefone, celular, endereco, numero, complemento, bairro, cep, estado, cidade, nascimento, rg, tipo, nivel, ativo, cadastro) VALUES
(1, 'Particular', 'particular', '8c4a6b36a09cceef20277eb19f83bae01800768e', '', '', '', 0, '', '', 0, '', '', '', '', '', 1, 1, '2014-06-30 21:57:33'),
(2, 'Revendedor', 'revendedor', 'd93cfa91bf07aeb3995f18c8a8426f3236161c63', '', '', '', 0, '', '', 0, '', '', '', '', '', 2, 1, '2014-06-30 21:57:33');
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;Discussão (1)
Carregando comentários...