Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once '_classes/user_login.php';
- $u = new User;
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>Inputs de usuario</title>
- <link rel="stylesheet" href="_css/style.css">
- </head>
- <body>
- <div>
- <h1>Cadastrar</h1>
- <form method="POST">
- <input type="" name="nNameUser" placeholder="Nome">
- <input type="" name="nEmail" placeholder="Email">
- <input type="" name="nSex" placeholder="Sexo"> <!--colocar opção por icones -Masculino/-Feminino-->
- <input type="" name="nCivilState" placeholder="Estado civil">
- <input type="" name="nBirthday" placeholder="Data nascimento">
- <input type="" name="nAlreadyJob" placeholder="Empregado atualmente?"> <!--//colocar opção por icones -Sim/-Não-->
- <input type="" name="nTelephone" placeholder="Telefone">
- <input type="" name="nMobile" placeholder="Celular">
- <input type="" name="nComercial" placeholder="Telefone comercial">
- <input type="" name="nPageHome" placeholder="Homepage">
- <input type="" name="nOringins" placeholder="Nacionalidade">
- <input type="" name="nCep" placeholder="Cep">
- <input type="" name="nAdress" placeholder="Endereço">
- <input type="" name="nHouseNumber" placeholder="Numero da casa">
- <input type="" name="nComplement" placeholder="Complemento">
- <input type="" name="nNighborhood" placeholder="Bairro">
- <input type="" name="nState" placeholder="Estado">
- <input type="" name="nCity" placeholder="Cidade">
- <input type="password" name="nPassword" placeholder="Senha">
- <input type="password" name="nConf" placeholder="Confirmar Senha">
- <input type="submit" value="Cadastrar">
- </form>
- </div>
- <?php
- if(isset($_POST["nNameUser"]))
- {
- $nome=addslashes($_POST["nNameUser"]);
- $email=addslashes($_POST["nEmail"]);
- $sexo=addslashes($_POST["nSex"]);
- $estado_civil=addslashes($_POST["nCivilState"]);
- $data_nascimento=addslashes($_POST["nBirthday"]);
- $empregado_atualmente=addslashes($_POST["nAlreadyJob"]);
- $telefone=addslashes($_POST["nTelephone"]);
- $celular=addslashes(isset($_POST["nMobile"])?$_POST["nMobile"]: 0);
- $telefone_comercial=addslashes(isset($_POST["nComercial"])?$_POST["nComercial"]: 0);
- $homepage=addslashes($_POST["nPageHome"]);
- $nacionalidade=addslashes($_POST["nOringins"]);
- $cep=addslashes($_POST["nCep"]);
- $endereço=addslashes($_POST["nAdress"]);
- $num_casa=addslashes($_POST["nHouseNumber"]);
- $complemento=addslashes($_POST["nComplement"]);
- $bairro=addslashes($_POST["nNighborhood"]);
- $estado=addslashes($_POST["nState"]);
- $cidade=addslashes($_POST["nCity"]);
- $senha=addslashes($_POST["nPassword"]);
- $confSenha=addslashes($_POST["nConf"]);
- }
- if(!empty($nome) && !empty($email) && !empty($sexo) && !empty($estado_civil) && !empty($data_nascimento) && !empty($empregado_atualmente) && !empty($telefone) && !empty($homepage) && !empty($nacionalidade) && !empty($cep) && !empty($endereço) && !empty($num_casa) && !empty($complemento) && !empty($bairro) && !empty($estado) && !empty($cidade) && !empty($senha) && !empty($confSenha))
- {
- $u->conect("dados_pessoais", "localhost", "root", "");
- if($u->msgError="")
- {
- if($senha == $confSenha){
- if($u->register($nome, $email, $sexo, $estado_civil, $data_nascimento, $empregado_atualmente, $telefone, $telefone, $celular, $telefone_comercial, $homepage, $nacionalidade, $cep, $endereço, $num_casa, $complemento, $bairro, $estado, $cidade, $senha))
- {
- ?>
- <div id="msg-sucesso">
- Dados inseridos com sucesso! Para acessar a sua área <strong><a href="#">Clique aqui!</a></strong>
- </div>
- <?php
- }
- else
- {
- ?>
- <div class="msg-erro">
- Email já cadastrado!
- </div>
- <?php
- }
- }
- else
- {
- ?>
- <div class="msg-erro">
- Senhas não correspondem!
- </div>
- <?php
- }
- }
- else
- {
- ?>
- <div class="msg-erro">
- <?php
- echo "ERRO: ".$u->msgError;
- ?>
- </div>
- <?php
- }
- }
- else
- {
- ?>
- <div class="msg-erro">
- Preencha todos os campos!
- </div>
- <?php
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement