Advertisement
Guest User

Untitled

a guest
Jun 19th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. function verifMail() {
  2. if (isset($_POST['mail'])) {
  3. $_POST['email'] = htmlspecialchars($_POST['mail']);
  4. if (preg_match("#^[_a-z0-9-]+(.[_a-z0-9-]+)*@[a-z0-9-]+(.[a-z0-9-]+)*(.[a-z]{2,3})$#", $_POST['mail'])) {
  5. return true;
  6. } else {
  7. return false;
  8. }
  9. }
  10. }
  11.  
  12. function verifMdp() {
  13. if (isset($_POST['mdp'])) {
  14. $_POST['mdp'] = htmlspecialchars($_POST['mdp']);
  15. if (preg_match("#^[a-zA-Zàâäéèêëçùûüôö]+[-' ]?[a-zA-Zàâäéèêëçùûüôö]+$#", $_POST['mdp'])) {
  16. return true;
  17. } else {
  18. return false;
  19. }
  20. }
  21. }
  22.  
  23. function verifAll() {
  24. $mailOk = verifMail();
  25. $mdpOk = verifMdp();
  26.  
  27. if ($mailOk && $mdpOk) {
  28. return true;
  29. } else {
  30. return false;
  31. }
  32. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement