gpt4 book ai didi

cakephp隐藏字段问题

转载 作者:行者123 更新时间:2023-12-01 09:57:56 24 4
gpt4 key购买 nike

我在名为 add.ctp 的 View 中的输入字段有问题。当输入类型设置为'text'时,程序序列正常。但是当我将输入类型更改为“隐藏”时,会显示以下错误:

The request has ben black-holed. Error: The requested address was not found on this server.



mod-rewrite 似乎已激活。任何想法,这可能是什么原因?

最佳答案

您的代码没有错误。 CakePHP's Security component检查隐藏的表单字段以防止最终用户篡改:

By default SecurityComponent prevents users from tampering with forms. It does this by working with FormHelper and tracking which files are in a form. It also keeps track of the values of hidden input elements. All of this data is combined and turned into a hash. When a form is submitted, SecurityComponent will use the POST data to build the same structure and compare the hash.



使用 FormHelper::unlockField 使字段免于此功能:
$this->Form->unlockField('User.id');

关于cakephp隐藏字段问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21652802/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com