Php 403 Ajax post请求上的禁止错误[codeigniter captcha]

Php 403 Ajax post请求上的禁止错误[codeigniter captcha],php,ajax,captcha,codeigniter-3,Php,Ajax,Captcha,Codeigniter 3,我在表单中添加验证码时遇到codeigniter问题。我刷新页面验证码有效,但如果我单击刷新图标,则验证码无效,然后在下图中显示错误: $(函数(){ $('.refresh')。单击(函数(){ var-res; $.ajax({ 键入:“POST”, 网址:'http://anana.dev/register/refresh_captcha', 成功:功能(res){ 如果(res){ $('.image').html(res); } } }) }); }); +这是我的表格: &l

我在表单中添加验证码时遇到codeigniter问题。我刷新页面验证码有效,但如果我单击刷新图标,则验证码无效,然后在下图中显示错误:


$(函数(){
$('.refresh')。单击(函数(){
var-res;
$.ajax({
键入:“POST”,
网址:'http://anana.dev/register/refresh_captcha',
成功:功能(res){
如果(res){
$('.image').html(res);
}
}
})
});
});
+这是我的表格:

<form action="/register" method="post" enctype="multipart/form-data">
<input type="hidden" name="<?=$csrf['name'];?>" value="<?=$csrf['hash'];?>" />
    <?php echo $captcha; ?>
    <a class="refresh" href="javascript:;">
        <img src="images/refresh.png">
    </a>
    <input type="text" name="captcha">
<button type="submit" class="button userlogin">Apply</button>


显示您到目前为止尝试过的内容…能否显示部分代码?是否正在检查页面中的csrf?更改未找到Url的权限,以便发生此错误。
<form action="/register" method="post" enctype="multipart/form-data">
<input type="hidden" name="<?=$csrf['name'];?>" value="<?=$csrf['hash'];?>" />
    <?php echo $captcha; ?>
    <a class="refresh" href="javascript:;">
        <img src="images/refresh.png">
    </a>
    <input type="text" name="captcha">
<button type="submit" class="button userlogin">Apply</button>