Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在一个表单中(在 Drupal 中)我想要一个临时字段,不需要将它的值保存在数据库中。所以我需要一种方法来防止表单将字段的值发送到 $_POST 数组。是否可以?
name
有关完整规则,请参阅表单提交:成功控制。
也就是说,您的方法非常非常错误。您不应该根据来自客户端的内容来决定将哪些内容放入数据库。客户可以给你发送任何东西!
只是不要给它name=""属性。
name=""
您也可以$_POST在将其放入数据库时将其从数组中排除
$_POST