Advertisement
Guest User

Untitled

a guest
Jan 21st, 2020
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. <?php
  2. session_start();
  3. include_once("test.php");
  4.  
  5. $senha = filter_input(INPUT_POST, 'senha', FILTER_SANITIZE_STRING);
  6.  
  7. //echo "senha: $senha <br>";
  8.  
  9. $result_senha = "INSERT INTO senha (senha) VALUES ('$senha', NOW())";
  10. $resultado_usuario = mysqli_query($conn, $result_senha);
  11.  
  12. if(mysqli_insert_id($conn)){
  13. $_SESSION['msg'] = "<p style='color:green;'>Usuário cadastrado com sucesso</p>";
  14. header("Location: index.php");
  15. }else{
  16. $_SESSION['msg'] = "<p style='color:red;'>Usuário não foi cadastrado com sucesso</p>";
  17. header("Location: index.php");
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement