我有一个使用 codeigniter 括号的表格
echo form_open('signup');
echo form_close();
当我提交它时,我收到以下错误
An Error Was Encountered
The action you have requested is not allowed.
不是 always
,但经常...
即使隐藏的输入字段存在于表单中:
<div style="display:none">
<input type="hidden" value="token name is here" name="csrf_token_name">
</div>
这也发生在类似的表单上(登录)
编辑:通过表单生成的 html
<form accept-charset="utf-8" method="post" action="http://www.example.com/signup">
<div style="display:none">
<input type="hidden" value="93565fb5855d31af3d46bd655b11a4a6" name="csrf_token_name">
</div>
<input id="username" type="text" placeholder="Username" maxlength="20" value="" name="username">
<input id="email" type="text" placeholder="Email" value="" name="email">
<input id="password" type="password" placeholder="Password" value="" name="password">
<input id="submit" type="submit" value="Sign up" name="submit">
</form>