我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

使用MongoDB和PHP避免注入风险

I have this function and I want to change the function so that there is no risk of injection. The function retrieves the form information:

function retrieve(){

    if(isSet($_POST['text'])|| $_POST['text']==" ") return null;
    return $_POST['text'];
}

I think I found with htmlentities:

function retrieve(){

    if(isSet($_POST['text'])|| $_POST['text']==" ") return null;
    return htmlentities($_POST['text']);
}

近期文章

  • 如何将Android应用程序连接到我的网站数据库? [关闭]
  • PHP没有将所有记录插入MySQL数据库
  • PHP for循环停止太早
  • 如何从php中的INSERT查询中提取变量?
  • 如何从数组中读取特定的set元素 - PHP
  • 如何使用ajax为数据库添加新输入和更新值
  • 如何在PHP中添加时间?
  • 在php中解析一个字符串
  • 如何使用php从MySql数据库打印网页上的结果[关闭]
  • 使用htaccess更新网址
  • 排序数据MYSQL [关闭]
  • 更新php5 Ubuntu
  • 新线无效
  • 具有用户名的虚拟子域
  • 在智能循环中以树格式打印
  • 在数组中输出文本字符串
  • 如何检索选择选项?
  • 我的IP Logger需要帮助
  • 数据库ID自动递增
  • sql查询显示所有天数存在于数据库的两个日期之间

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华