Advertisement
Guest User

Untitled

a guest
Jun 11th, 2017
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 KB | None | 0 0
  1. <?php include "site/head.php"; ?>
  2. <?php
  3.    
  4.     mysql_connect($mysql_host, $mysql_user, $mysql_pass);
  5.     mysql_select_db($mysql_logon); 
  6.    
  7.  
  8. $username = $_POST['username'];
  9. $password =$_POST['password'];
  10. $password2 =$_POST['password2'];
  11. $email = $_POST['email'];
  12.  
  13. if ($username==NULL | $password==NULL | $password2==NULL | $email==NULL){
  14. echo "Some empty field.";
  15. echo "Try again.";
  16. }
  17. else
  18. {}
  19.  
  20. if ($password!=$password2) {
  21. echo "Pass not match";
  22. }
  23. else
  24. {}
  25. $qry_check_username = mysql_query("SELECT username FROM `account` WHERE username='$username'");
  26. function sha_password($user,$pass)
  27. {
  28.     $user = strtoupper($user);
  29.     $pass = strtoupper($pass);
  30.     return SHA1($user.':'.$pass);
  31. }
  32.  
  33. $password = sha_password($username,$_POST['password']);
  34.  
  35. mysql_query("INSERT INTO account (username,sha_pass_hash,email) VALUES
  36. ('$username', '$password', '$email)");
  37.  
  38. echo "Account created.";
  39. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement