Re: [Linux-programlama] [PHP - gercek email adresi kontrolu]

---------

New Message Reply About this list Date view Thread view Subject view Author view Attachment view

From: hakan@soulmaster.org
Date: Fri 15 Jul 2005 - 09:54:10 EEST


Merhaba,
duzenli ifade ile hazirlanan kontrolden sonra

if (checkdnsrr($alan_adi, 'A') && checkdnsrr($alan_adi, 'MX')) {
}
else {
}

gibi bir kontrol yapisi da kullanilabilir.

--
Hakan POLATKAN
--

Quoting Devrim GUNDUZ <devrim@gunduz.org>:

> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > > Merhaba, > > On Tue, 12 Jul 2005, bunyamin wrote: > > > bir e-mail adersinin gercek olup olmadigini anlayan bi fonksiyona > > ihtiyacım var... > > > > boyle bi kod varmi?? > > > > kisi e-mail adresini yazınca boyle bir e-mail adresi gercekten varmi > > yokmu kontrol etmeli... > > Bu biraz zor; ama en azından alan adını vs kontrol eden birşey ararsanız > şunu kullanabilirsiniz. Bunu PostgreSQL.org'da kullanıyoruz biz: > > ============================================= > function verify_email($Address) > { > /* Check the email address structure > // Returns 0 if the email is correctly structured and has a valid MX > record > // Returns 1 if incorrectly structured (i.e. invalid and could never > work) > Returns 2 if it seems alright but there is no valid dns entry > */ > if > (eregi("^([-!#\$%&'*+./0-9=?A-Z^_`a-z{|}~])+@([-!#\$%&'*+/0-9=?A-Z^_`a-z{|}~]+\\.)+[a-zA-Z]{2,4}\$", > $Address) == 0) > { > return 1; > } > > // Get the user/domain > $User = strtok($Address,"@"); > $Domain = strtok("") . "."; > > $ // Check for the domain MX records > if (getmxrr($Domain, $Servers)) { > return 0; > } > > $ // No MX record, so maybe it's a host > if (gethostbyname($Domain) == $Domain) { > return 2; > } else { > return 0; > } > } > ======================================================= > > Bunu da şu şekilde kullanacaksınız: > > $emailret = verify_email(rawurldecode($e_posta_adresi)); > if ($emailret != 0) > { > // E-posta adresi gecersiz > ... > exit(); > } > > > Saygılar, > > - -- > Devrim GUNDUZ > devrim~gunduz.org, devrim~PostgreSQL.org, devrim.gunduz~linux.org.tr > http://www.tdmsoft.com.tr http://www.gunduz.org > -----BEGIN PGP SIGNATURE----- > Version: GnuPG v1.2.1 (GNU/Linux) > > iD8DBQFC1vODtl86P3SPfQ4RAonyAKCMTfJOLoLq8gtIJItaLvrOttqzTgCgosW/ > SL9KN2mRktMAyLIaKCpPNgE= > =K2Jj > -----END PGP SIGNATURE-----

---------------------------------------------------------------- This message was sent using IMP, the Internet Messaging Program.

_______________________________________________ Linux-programlama mailing list Linux-programlama@liste.linux.org.tr http://liste.linux.org.tr/mailman/listinfo/linux-programlama


New Message Reply About this list Date view Thread view Subject view Author view Attachment view

---------

Bu arsiv hypermail 2.1.2 tarafindan uretilmistir.