当我向表单添加验证码时,我遇到了codeigniter的问题。我刷新了验证码工作的页面,但如果我点击刷新图标它不起作用,那么在下图中显示错误:
<script>
$(function(){
$('.refresh').click(function(){
var res;
$.ajax({
type: 'POST',
url: 'http://anana.dev/register/refresh_captcha',
success: function(res){
if(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>