Guest User

Untitled

a guest
Dec 29th, 2017
106
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. <?php
  2. require('connect.php');
  3. // If the values are posted, insert them into the database.
  4. if (isset($_POST['username']) && isset($_POST['password'])){
  5. $username = $_POST['username'];
  6. $email = $_POST['email'];
  7. $password = $_POST['password'];
  8. $confpassword = $_POST['confirm_password'];
  9. if ($_POST["password"] === $_POST["confirm_password"]) {
  10. echo 'Password Matched';
  11. }
  12. else {
  13. echo 'Password Match Failed';// failed :(
  14. }
  15. $hashPassword = password_hash($password,PASSWORD_BCRYPT);
  16. $query = "INSERT INTO `user` (username, password, email) VALUES ('$username', '$password', '$email')";
  17. $result = mysqli_query($connection, $query);
  18. if($result){
  19. $smsg = "User Created Successfully.";
  20. }else{
  21. $fmsg ="User Registration Failed";
  22. }
  23. }
  24. ?>
Add Comment
Please, Sign In to add comment