php - Session captcha is always wrong -
here link captcha code im using click here problem when post captcha code wrong when im doing verification. shows error message not validating how utilize session['captcha']['code'] without messing every post wrong must alter after post , different in session when print($_session) value there captcha entered , matched.
php: on same page.
<?php session_start(); $_session['captcha'] = captcha(); $captcha_code = $_post["captcha_code"]; if(isset($_post["captcha_code"]) ){ verification here // if(....) { if(strtolower($captcha_code) != strtolower($_session["captcha"]["code"])) { $error_message .= "<li>the code entered incorrect.</li>"; $haserror = true; } } }
since can't verify contents of captcha.php file - can't help much issue. however, possibility.
your $_session['captcha'] = captcha(); seems wrong me {because can't find source captcha.php}. if it's setting session on same page load form beingness posted, how sure it's not different captcha session beingness set when utilize print_r($_session) call? if know mean. in captcha() function (captcha.php file), setting session there well, without confirming false post? thus, changing on page load of $_post? in other words - ensuring doesn't "reset" when form posted before validating users input.
where captcha.php code?
also, seem missing include("captcha.php"); after session_start(); call. may issue right there. but, can't confirm.
php
No comments:
Post a Comment