- android - RelativeLayout 背景可绘制重叠内容
- android - 如何链接 cpufeatures lib 以获取 native android 库?
- java - OnItemClickListener 不起作用,但 OnLongItemClickListener 在自定义 ListView 中起作用
- java - Android 文件转字符串
$str = '"mynam@blabl"@domanin.com';
filter_var($str, FILTER_VALIDATE_EMAIL);//return valid email.
上面的电子邮件返回 true... RFC 2822 说它是一个合法的电子邮件地址。
我的问题是,如果您使用上述方法验证电子邮件,即使您已使用 filter_var 对其进行过滤,电子邮件是否会携带可能损害数据库的 sql 注入(inject)?
最佳答案
my question is if you validate an email using the above could an email carry sql injections that can harm the db even though you have filtered it with filter_var?
filter_var
不是像 mysql_real_escape_string()
这样的数据库特定卫生设施的替代品!人们也需要始终应用这一点。
关于php - FILTER_VALIDATE_EMAIL 是否使字符串可以安全地插入数据库?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4154685/
我知道之前已经讨论过这个问题,但自从 2010 年底发表这篇文章以及当时提出问题的其他讨论以来 - Does FILTER_VALIDATE_EMAIL make a string safe for
我试图允许用户在我的 PHP 系统中编辑他们的电子邮件地址,但也阻止他们设置已经存在的电子邮件地址,我还尝试通过 FILTER_VALIDATE_EMAIL 运行它们。然而它对我来说停在某个地方。这些
$str = '"mynam@blabl"@domanin.com'; filter_var($str, FILTER_VALIDATE_EMAIL);//return valid email. 上面
示例有效电子邮件地址: "this is a valid address"@example.com PHP代码:
使用 PHP 的 FILTER_VALIDATE_EMAIL 时允许的最大字符长度是多少? 我正在测试我的脚本以测试允许的最大长度 (200) 的功能,但是当我使用超过 200 个字符的电子邮件时,P
我肯定在这里遗漏了一些东西。由于某种原因 filter_var 不工作。我正在尝试验证来自 $_POST 的电子邮件,即使是有效的电子邮件,它也会返回 false。但是,当我对电子邮件进行硬编码时,它
我使用的是 PHP 5.3.10。这是代码: 它返回:"Email: test@example.c correct. 我认为只有一个字符的顶级域是不正确的(根据此列表,我不知道一个字符长度的 TLD
我知道有很多关于此的问题,但是我似乎无法通过我的编码找出错误。我知道这很简单,但我看不到它。 我必须创建一个表单,当提交该表单时,数据将被输入到MySQL数据库中,但是需要首先验证数据。我有两个问题,
这个问题已经有答案了: How can I validate an email address using a regular expression? (73 个回答) 已关闭 9 年前。 我需要
在 Zend_Validate_EmailAddress 和 filter_var(..., FILTER_VALIDATE_EMAIL) 中,验证电子邮件地址时哪个更好,为什么? 最佳答案 两者都可
我有一个页面,我想在其中接受 GET 参数中的电子邮件地址。如果我使用 FILTER_VALIDATE_EMAIL,我是否仍然容易受到 xss 和 javascript 注入(inject)攻击等攻击
我只是在创建一个注册表单,我只想将有效且安全的电子邮件插入数据库。 一些网站(包括 w3schools)建议在运行 FILTER_VALIDATE_EMAIL 之前运行 FILTER_SANITIZE
我正在使用 filter_var($email, FILTER_VALIDATE_EMAIL) 验证电子邮件。 如果上述函数返回false,我想回应一个声明“无效的电子邮件”。然而,不管页面加载时的
因此,我计划使用 shell_exec() 来处理运行发送电子邮件的 php 脚本。 一切都运行良好,但我只是有点担心仅使用 FILTER_VALIDATE_EMAIL 来确保不会发生注入(injec
因此,我计划使用 shell_exec() 来处理运行发送电子邮件的 php 脚本。 一切都运行良好,但我只是有点担心仅使用 FILTER_VALIDATE_EMAIL 来确保不会发生注入(injec
在阅读了各种帖子后,我决定不使用 REGEX 来检查电子邮件是否有效,而只使用 PHP 的内置 filter_var 函数。它似乎工作正常,直到它开始告诉我一封电子邮件无效,因为我有一个号码。 即 n
我刚刚为一个表单设置验证,我决定尝试使用 filter_var 函数来检查我的电子邮件地址的有效性。我无法找出 filter_var 在任何地方实际允许的内容(因为文档非常简单),而且我发现它允许像
我是一名优秀的程序员,十分优秀!