php - 如何停止 php 中的 url 垃圾邮件已将 url 验证放在 msg 字段上但不起作用
问题描述
无法停止 PHP 中 msg 字段中的垃圾邮件 url 链接已进行 preg_match() 检查,但它也被绕过了。
这怎么可能是我的代码:
if($_SESSION['captcha_code']==$_POST['captcha'])
{
$regex = "/(http:\/\/|)(www.|)[\d\w-]{2,63}\.[A-Z]{2,4}(\.[A-Z]{2,4}|)/i";
if (preg_match($regex,$_POST['message'],$match))
{
echo '<script>alert("URL links are not allowed, please remove following URL link from the message");window.history.go(-1);</script>'; return;
}
解决方案
推荐阅读
- reactjs - 为什么单击链接时我的 React 应用程序没有导航到页面?
- python - 使用卷在 Docker 中运行 Flask 导致重新加载时出错
- javascript - 正则表达式测试表达式
- templates - 在 Go 模板中按名称访问结构成员
- facebook - og:url 不代表输入的 URL。仔细检查提供的值后,您可以放心地忽略此消息
- c# - 如何从 C# 中单独文件夹中的文件导入命名空间
- javascript - 着色器练习册
- c# - AForge - VideoCapabilities 列表不完整 - 高帧率
- python - GnuRadio 记录器附加文件标志不起作用?
- typescript - TypeError:admin.firestore.FieldValue.increment 不是函数