View Single Post
Old 12-06-2007, 06:01 PM   #16 (permalink)
WinSrev
The Acquainted
Inquisitive 
 
WinSrev's Avatar
 
Join Date: Sep 2007
Posts: 133
Thanks: 6
WinSrev is on a distinguished road
Default

If you need one for an email address (here's something i came across in my functions file, not sure who's it is, but it's not mine)

PHP Code:
function check_email($email
{
    if(
preg_match('/^\w[-.\w]*@(\w[-._\w]*\.[a-zA-Z]{2,}.*)$/'$email$matches))
    {
        if(
function_exists('checkdnsrr'))
        {
            if(
checkdnsrr($matches[1] . '.''MX')) return true;
            if(
checkdnsrr($matches[1] . '.''A')) return true;
        }else{
            if(!empty(
$hostName))
            {
                if( 
$recType == '' $recType "MX";
                
exec("nslookup -type=$recType $hostName"$result);
                foreach (
$result as $line)
                {
                    if(
eregi("^$hostName",$line))
                    {
                        return 
true;
                    }
                }
                return 
false;
            }
            return 
false;
        }
    }
    return 
false;

Send a message via ICQ to WinSrev
WinSrev is offline  
Reply With Quote
The Following 2 Users Say Thank You to WinSrev For This Useful Post:
iflashlord (04-23-2009), Wildhoney (12-06-2007)