我目前在我的網站上使用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