Advertisement
patryk178

Untitled

Sep 12th, 2019
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Hasło</title>
  6. </head>
  7. <body>
  8. <form action="" method="post">
  9. <input type="text" name="pass">
  10. <input type="submit">
  11. </form>
  12. <?php
  13.  
  14. if(isset($_POST['pass']))
  15. {
  16. $pass = $_POST['pass'];
  17.  
  18. if (strlen(preg_replace('/[^A-Z]/','',$pass))<2)echo '<br>hasło musi zawierać przynajmniej dwie wielkie litery<br>';
  19. if (strlen(preg_replace('/[^0-9]/','',$pass))<2)echo '<br>hasło musi zawierać przynajmniej dwie cyfry<br>';
  20. if (strlen(preg_replace('/[^!@#$%\^&*()_+~\[\]\{\}\\`,.\/<>?]/','',$pass))<2)echo '<br>hasło musi zawierać przynajmniej dwa znaki specjalne<br>';
  21. }
  22.  
  23. ?>
  24. </body>
  25. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement