Advertisement
Guest User

Untitled

a guest
Jul 19th, 2017
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.42 KB | None | 0 0
  1. <?php
  2.  
  3. function CheckInputs_Create_Change($username, $password, $passwordagain)
  4. {
  5. if($username == "" || $password == "" || $passwordagain == "")
  6. {
  7. return false
  8. }
  9. else
  10. {
  11. if($password==$passwordagain)
  12. {
  13.  
  14. if(strpos($username," ") !== false || strpos($password, " ") !== false || strpos($passwordagain, " ") !== false)
  15. {
  16. return false
  17. }
  18. else
  19. {
  20. if(preg_match("^b[a-zA-Z0-9_]+b$", $username) != 1 || preg_match("^b[a-zA-Z0-9_]+b$", $password) != 1 || preg_match("^b[a-zA-Z0-9_]+b$", $passwordagain) != 1)
  21. {
  22. return false;
  23. }
  24. else
  25. {
  26. if(mb_detect_encoding($username, 'UTF-8')!== 'UTF-8' || mb_detect_encoding($password, 'UTF-8')!== 'UTF-8' || mb_detect_encoding($passwordagain, 'UTF-8') !=='UTF-8')
  27. {
  28. return false
  29. }
  30. else
  31. {
  32. return true
  33. }
  34. }
  35. }
  36. }
  37. else
  38. {
  39. return false
  40. }
  41. }
  42. }
  43. ?>
  44.  
  45. $output=CheckInputs_Create_Change($username, $password, $passwordagain);
  46.  
  47. if($output==true)
  48.  
  49. include 'CheckInputs_Create_Change.php';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement