English 中文(简体)
php 联系表在用户提供非工作返回电子邮件地址时无效
原标题:php contact form doesn t work when user supplies non-working return email address

我有一个 PHP 联系表, 仅在用户提供有效的回信电子邮件地址( 电子邮件格式正确, 只是不是一个有效的有效工作电子邮件) 时才将表格数据发送给我。 我无法看到他们提供的其他任何数据, 即姓名、 电话号码或评论。 它总是永远无法到达我手中 。 通常事情是这样运作的吗? 电子邮件系统是否真的检查一个有效的回信电子邮件地址, 可以实际发送/ 接收电子邮件?

问题回答

你可以确认它是一个适当的电子邮件 这样:

$result = filter_var($email, FILTER_VALIDATE_EMAIL);
if ($result == TRUE) {
   //is an email
   } else {
   //not an email
}

"http://php.net/manual/en/conference.filter-var.php" rel="nofollow">filter_var()

"http://www.php.net/manual/en/filter.filters.validate.php" rel="nofollow" >验证过滤器





相关问题
Brute-force/DoS prevention in PHP [closed]

I am trying to write a script to prevent brute-force login attempts in a website I m building. The logic goes something like this: User sends login information. Check if username and password is ...

please can anyone check this while loop and if condition

<?php $con=mysql_connect("localhost","mts","mts"); if(!con) { die( unable to connect . mysql_error()); } mysql_select_db("mts",$con); /* date_default_timezone_set ("Asia/Calcutta"); $date = ...

定值美元

如何确认来自正确来源的数字。

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need ...

Text as watermarking in PHP

I want to create text as a watermark for an image. the water mark should have the following properties front: Impact color: white opacity: 31% Font style: regular, bold Bevel and Emboss size: 30 ...

How does php cast boolean variables?

How does php cast boolean variables? I was trying to save a boolean value to an array: $result["Users"]["is_login"] = true; but when I use debug the is_login value is blank. and when I do ...

热门标签