-1
我有一個形式與phpcaptcha.org。但是,當我提交表單時,我看到一個白色屏幕,驗證碼腳本不起作用,其他代碼工作。 有人可以幫助我什麼是錯誤的驗證碼?php captcha.org不起作用
在此先感謝。
我提交的代碼是:
<?php
session_start();
//captcha
include_once $_SERVER['DOCUMENT_ROOT'] . 'securimage/securimage.php';
$securimage = new Securimage();
include 'connect.php';
$sql = "INSERT INTO users (username, password)VALUES (?, ?)";
$stmt = $link->prepare($sql);
$stmt->bind_param("ss", $username, $password);
$username = $_POST['username'];
$password = md5($_POST['password']);
$stmt->execute();
//captcha
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
echo "The security code entered was incorrect.<br /><br />";
echo "Please go <a href='javascript:history.go(-1)'>back</a> and try again.";
exit;
}
if (! $sql) {
echo "Account not created";
}
echo 'Account created, click <a href="index.php">here</a>';
$stmt->close();
mysqli_close($link);
?>
ini_set('display_errors',1); ini_set('display_startup_errors',1); error_reporting(E_ALL); 併發布錯誤。 –
錯誤是:警告:include_once(C:/xampp/htdocssecurimage/securimage.php):未能打開流:第12行的C:\ xampp \ htdocs \ folder \ register.php中沒有這樣的文件或目錄 警告:include_once():無法在C:\ xampp \ htdocs \ folder \ register.php中打開包含(include_path ='.; C:\ xampp \ php \ PEAR')的'C:/xampp/htdocssecurimage/securimage.php' on line 12 致命錯誤:在第13行的C:\ xampp \ htdocs \ folder \ register.php中找不到類'Securimage' – maichel
閱讀錯誤消息,然後閱讀第5行。您缺少目錄分隔符。將第5行更改爲'include_once $ _SERVER ['DOCUMENT_ROOT']。 「/ securimage/securimage.php'' –