我目前在我的网站上使用securimage进行验证码验证。在the quickstart guide中给出的例子工作得很好。但是,与其指导处理页面并回显一个随机语句,我希望它的行为方式与在the demo page中显示的消息框错误验证码在同一页面上输入时相同。我环顾了JavaScript或Jquery的源代码,它启用了此功能,但无法找到任何内容。任何指针赞赏实现此功能。Securimage CAPTCHA表格处理
我想要达到的流量是;
- > form进入 - >进入“process.php” - > if“captcha错误值” - “主要形式回显”。我怎样才能在窗体本身显示回声声明?那是我想知道的。不要将用户导向“process.php”文件并显示错误回显。
以下是部分流程代码,用于确定输入到captcha的值是对还是错。
include_once $_SERVER['DOCUMENT_ROOT'] . '/securimage/securimage.php';
$securimage = new Securimage();
if ($securimage->check($_POST['captcha_code']) == false) {
// the code was incorrect
// you should handle the error so that the form processor doesn't continue
// or you can use the following code if there is no validation or you do not know how
$captchaerror = "The security code entered was incorrect.<br /><br />";
exit;
}
没有js,php简单回显文本 – 2011-03-23 21:31:13
你不需要Java脚本,你可以在用户提交错误的验证码时回显消息。 – SIFE 2011-03-23 23:28:25