Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> zprawdzanie Maila
szczechu96
post
Post #1





Grupa: Zarejestrowani
Postów: 20
Pomógł: 0
Dołączył: 18.03.2011

Ostrzeżenie: (0%)
-----


Ja zrobić żeby strona sprawdzała czy dany Mail istniej
tak jak na stonie link(kliknij)
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
neosatan
post
Post #2





Grupa: Zarejestrowani
Postów: 79
Pomógł: 2
Dołączył: 29.04.2009
Skąd: wrocław

Ostrzeżenie: (0%)
-----


ja używam czegoś takiego
  1. function isValidEmail($mail)
  2. {
  3. $wholeexp = '/^(.+?)@(([a-z0-9\.-]+?)\.[a-z]{2,5})$/i';
  4. $userexp = "/^[a-z0-9\~\\!\#\$\%\&\(\)\-\_\+\=\[\]\;\:\'\"\,\.\/]+$/i";
  5.  
  6. /* //if you have a lunix/unix server then uncomment this block of code
  7. // on windows servers MX isn't declared and checkdnsrr() function don't work
  8. // so if your server is running on windows this method will validate email address only againts regular expresion
  9. if (preg_match($wholeexp, $mail, $regs)) {
  10. $username = $regs[1];
  11. $host = $regs[2];
  12.  
  13. if (checkdnsrr($host, MX)) {
  14. if (preg_match($userexp, $username)) {
  15. return true;
  16. } else { return false; }
  17. } else { return false; }
  18. } else { return false; }
  19. */
  20. // if your server is running under linux/unix os then comment code block below
  21. if (preg_match($wholeexp, $mail, $regs))
  22. return true;
  23. else
  24. return false;
  25. }

zresztą chyba nawet zaczerpnięte z tego forum.
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 3.10.2025 - 10:49