here is the link to the captcha code that im using click here The problem is when I post the captcha code it always say its incorrect when Im doing my verification. it always shows the error message so its not validating properly how do i use the session['captcha']['code'] without it messing up every post back Something is wrong like it must change after post back and is different in the session but when i print($_SESSION) the value is there for the captcha to be entered and matched.
PHP: all on the same page.
<?PHP
session_start();
$_SESSION['captcha'] = captcha();
$captcha_code = $_POST["captcha_code"];
if(isset($_POST["captcha_code"]) ){
do verification here //
if(....) {
if(strtolower($captcha_code) != strtolower($_SESSION["captcha"]["code"])) {
$error_message .= "<li>The code you entered is incorrect.</li>";
$hasError = true;
}
}
}