Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- require_once('ketnoi.php');
- $salt = substr(str_shuffle("0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"), 0, 8);
- if(isset($_POST['dangky'])){
- $username = $_POST['username'];
- $password = $_POST['password'];
- $hashedPassword = '$SHA$' . $salt . '$' . hash('sha256', hash('sha256', $password) . $salt);
- $email = $_POST['email'];
- if($username == ""|| $password == ""|| $email == ""){
- echo "Vui long nhap day du thong tin";
- }else{
- $sql="INSERT INTO authme (username, password, ip, lastlogin, x, y, z, world, email , isLogged)
- VALUES ('$username', '$hashedPassword', '$email')";
- mysqli_query($ketnoi,$sql);
- echo "Dang ky thanh cong";
- }
- }
- ?>
- <form action="register.php" method="post">
- Player: <input type="text" name="username"> </br>
- password: <input type="text" name="password"> </br>
- Email: <input type="text" name="email"> </br>
- <input type="submit" name="dangky" value="dangky">
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement