<form id="form" action="" method="post">
<div class="form-group">
<input name="code" type="text" class="form-control" placeholder="请输入验证码" style="width:65%;display:inline;">
<img src="/web/index.php?c=utility&a=code&" class="img-rounded" style="cursor:pointer; width:30%;" οnclick="this.src='/web/index.php?c=utility&a=code&' + Math.random();" />
</div>
<input type="submit" class="btn btn-info btn-block" name="submit" value="立即查询">
<input type="hidden" name="token" value="{$_W['token']}">
</form>
php文件
if(checksubmit()){ //验证是否是表单提交
$code = $_GPC['code']; //接受code
$hash = md5($code . $_W['config']['setting']['authkey']); //微擎验证码加密方式
if($_GPC['__code'] != $hash) { //对比
message('你输入的验证码不正确, 请重新输入.');
}
}