Showing posts with label cake php. Show all posts
Showing posts with label cake php. Show all posts

Friday, January 2, 2009

PHP Email Address Domain Validation

Many email address validators will actually validate the email address formate, but they are not validating email address domain whether the domain really exists or not. For example example@test.com. In this email the domain is not exists in the real world, but its valid formate. We can stop this by checking the MX (Mail Exchanger) for the given hostname.

function checkEmail($StrEmail){
////// Before validate mail domain check email formate

list($StrUserName,$StrHostName) = split(‘@’,$StrEmail);
$arrMx = dns_get_record($StrHostName,MX);
if($arrMx){
return true;
}else{
return false;
}
}
checkEmail(”test@test.com“); ///////// returns false
checkEmail(”test@gmail.com“); ///////// returns true
?>

Note : This will work only in linux and not work in windows but there is a option in PEAR Net DNS package.

Wednesday, November 14, 2007

Cake PHP

Cake is a rapid development framework for PHP which uses commonly known design patterns like ActiveRecord, Association Data Mapping, Front Controller and MVC. Our primary goal is to provide a structured framework that enables PHP users at all levels to rapidly develop robust web applications, without any loss to flexibility. To know more about this click here.

Yahoo! News: Technology News