Advertisement
Guest User

Untitled

a guest
Jun 15th, 2019
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.17 KB | None | 0 0
  1. <?php
  2. require_once '_classes/user_login.php';
  3. $u = new User;
  4. ?>
  5. <!DOCTYPE html>
  6. <html>
  7. <head>
  8. <meta charset="utf-8">
  9. <title>Inputs de usuario</title>
  10. <link rel="stylesheet" href="_css/style.css">
  11. </head>
  12. <body>
  13. <div>
  14.  
  15. <h1>Cadastrar</h1>
  16.  
  17. <form method="POST">
  18.  
  19. <input type="" name="nNameUser" placeholder="Nome">
  20. <input type="" name="nEmail" placeholder="Email">
  21. <input type="" name="nSex" placeholder="Sexo"> <!--colocar opção por icones -Masculino/-Feminino-->
  22. <input type="" name="nCivilState" placeholder="Estado civil">
  23. <input type="" name="nBirthday" placeholder="Data nascimento">
  24. <input type="" name="nAlreadyJob" placeholder="Empregado atualmente?"> <!--//colocar opção por icones -Sim/-Não-->
  25. <input type="" name="nTelephone" placeholder="Telefone">
  26. <input type="" name="nMobile" placeholder="Celular">
  27. <input type="" name="nComercial" placeholder="Telefone comercial">
  28. <input type="" name="nPageHome" placeholder="Homepage">
  29. <input type="" name="nOringins" placeholder="Nacionalidade">
  30. <input type="" name="nCep" placeholder="Cep">
  31. <input type="" name="nAdress" placeholder="Endereço">
  32. <input type="" name="nHouseNumber" placeholder="Numero da casa">
  33. <input type="" name="nComplement" placeholder="Complemento">
  34. <input type="" name="nNighborhood" placeholder="Bairro">
  35. <input type="" name="nState" placeholder="Estado">
  36. <input type="" name="nCity" placeholder="Cidade">
  37. <input type="password" name="nPassword" placeholder="Senha">
  38. <input type="password" name="nConf" placeholder="Confirmar Senha">
  39. <input type="submit" value="Cadastrar">
  40. </form>
  41.  
  42. </div>
  43.  
  44. <?php
  45. if(isset($_POST["nNameUser"]))
  46. {
  47. $nome=addslashes($_POST["nNameUser"]);
  48. $email=addslashes($_POST["nEmail"]);
  49. $sexo=addslashes($_POST["nSex"]);
  50. $estado_civil=addslashes($_POST["nCivilState"]);
  51. $data_nascimento=addslashes($_POST["nBirthday"]);
  52. $empregado_atualmente=addslashes($_POST["nAlreadyJob"]);
  53. $telefone=addslashes($_POST["nTelephone"]);
  54. $celular=addslashes(isset($_POST["nMobile"])?$_POST["nMobile"]: 0);
  55. $telefone_comercial=addslashes(isset($_POST["nComercial"])?$_POST["nComercial"]: 0);
  56. $homepage=addslashes($_POST["nPageHome"]);
  57. $nacionalidade=addslashes($_POST["nOringins"]);
  58. $cep=addslashes($_POST["nCep"]);
  59. $endereço=addslashes($_POST["nAdress"]);
  60. $num_casa=addslashes($_POST["nHouseNumber"]);
  61. $complemento=addslashes($_POST["nComplement"]);
  62. $bairro=addslashes($_POST["nNighborhood"]);
  63. $estado=addslashes($_POST["nState"]);
  64. $cidade=addslashes($_POST["nCity"]);
  65. $senha=addslashes($_POST["nPassword"]);
  66. $confSenha=addslashes($_POST["nConf"]);
  67.  
  68. }
  69.  
  70. 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))
  71.  
  72. {
  73. $u->conect("dados_pessoais", "localhost", "root", "");
  74.  
  75. if($u->msgError="")
  76. {
  77. if($senha == $confSenha){
  78. 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))
  79. {
  80. ?>
  81. <div id="msg-sucesso">
  82. Dados inseridos com sucesso! Para acessar a sua área <strong><a href="#">Clique aqui!</a></strong>
  83. </div>
  84. <?php
  85. }
  86. else
  87. {
  88. ?>
  89. <div class="msg-erro">
  90. Email já cadastrado!
  91. </div>
  92. <?php
  93. }
  94.  
  95. }
  96. else
  97. {
  98. ?>
  99. <div class="msg-erro">
  100. Senhas não correspondem!
  101. </div>
  102. <?php
  103. }
  104.  
  105. }
  106. else
  107. {
  108. ?>
  109. <div class="msg-erro">
  110. <?php
  111. echo "ERRO: ".$u->msgError;
  112. ?>
  113. </div>
  114. <?php
  115. }
  116.  
  117. }
  118. else
  119. {
  120. ?>
  121. <div class="msg-erro">
  122. Preencha todos os campos!
  123. </div>
  124. <?php
  125. }
  126. ?>
  127.  
  128. </body>
  129. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement