⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 e-mail.php

📁 这是php专业项目实例开发一书的源代码,希望对大家有所帮助!
💻 PHP
字号:
<html>
<head>
<title> e-mail validator </title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<body bgcolor="#FFFFFF" text="#000000">

<?php

if (!isset($email))
{
 die("Hostname value wasnt properly submitted.Retry.");
}

if(empty($email))
{
 die("Hostname field was left blank ! Retry."); 
}

if ( (strlen($email) < 3) || (strlen($email) > 200))
{
 die("Invalid email address, email address too long or too short.");
}
elseif(!ereg("@",$email))
{
 die("Invalid email address, no @ symbol found");
}
else
{
 echo "<b>".$email."</b> is correct in format.<br>";
}

list($username,$hostname) = split("@",$email);

if ( (empty($username)) or (empty($hostname)) )
{
 die("username or hostname section is not valid.");
}

if(checkdnsrr($hostname))
{
 echo "<b>". $email ."</b>'s hostname has a valid MX record !<br>";
}
else
{
 die("<b>". $email ."</b>'s hostname does not exist");
}


?>

<br>
To test another hostname<A href="email.htm"> click here </a>
<br>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -