Advertisement
Guest User

Untitled

a guest
Sep 27th, 2016
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.94 KB | None | 0 0
  1. <?php
  2. require_once('ketnoi.php');
  3. $salt = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 8);
  4. if(isset($_POST['dangky'])){
  5. $username = $_POST['username'];
  6. $password = $_POST['password'];
  7. $hashedPassword = '$SHA$' . $salt . '$' . hash('sha256', hash('sha256', $password) . $salt);
  8. $email = $_POST['email'];
  9. if($username == ""|| $password == ""|| $email == ""){
  10. echo "Vui long nhap day du thong tin";
  11. }else{
  12. $sql="INSERT INTO authme (username, password, ip, lastlogin, x, y, z, world, email , isLogged)
  13. VALUES ('$username', '$hashedPassword', '$email')";
  14. mysqli_query($ketnoi,$sql);
  15. echo "Dang ky thanh cong";
  16. }
  17. }
  18.  
  19.  
  20. ?>
  21. <form action="register.php" method="post">
  22. Player: <input type="text" name="username"> </br>
  23. password: <input type="text" name="password"> </br>
  24. Email: <input type="text" name="email"> </br>
  25. <input type="submit" name="dangky" value="dangky">
  26. </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement