Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
Sorry for being such a newb and asking a seemingly easy question but hey i cant figure this thing out.
Ive gone to lots of freaking tutorials and most of them assume a hight level of PHP knowledge than i currently possess.
anyways im using nslookup.exe in of course an email verification. The code for that function is as followsCode: Select all
function Email ($Email) {
$Email = $_POST['Email'];
list($userName, $mailDomain) = split("@", $Email);
$false = "Invalid Email Address";
if(!empty($userName)) {
if( $mailDomain == '' ) $mailDomain = "MX";
exec('nslookup.exe -type=mx ' .$mailDomain, $result);
// check each line to find the one that starts with the host
// name. If it exists then the function succeeded.
foreach ($result as $line) {
if(eregi("^$mailDomain",$line)) {
if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $Email)) {
return $Email;
}
}
}return $false;
}return $false;
}And it appears that this function is returning TRUE anything that has a hostname that is a real site.
example-> "sansoo@hotmil.com" returned TRUE
hotmil.com is a parked domain name.
THis i dont understand because i have been to other sights and they were somehow able to see that i had miss typed my email address and it didnt pass. With my function you can type in anything that there is a registered TLD for.
I dont get it and i need some help either fixing this function or scrapping it and doing something better
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]