I’m using securimage to generate captchas. (http://www.phpcaptcha.org/)
I have the following code to verify a captcha:
<?php
session_start();
include_once('./securimage.php');
$securimage = new Securimage();
echo "Entered: ".$_GET['captcha']."<br>\n";
if($securimage->check($_GET['captcha'])==false){
echo "captcha invalid";
}else{
echo "OK";
}
?>
The problem is, when I visit the url (http://109.123.109.205/lib/securimage/verify.php?captcha=z6fega), it keeps returning “captcha invalid”!
Here is the captcha image url: http://109.123.109.205/lib/securimage/securimage_show.php
I hope someone can help.
Many thanks in advance,
Could be a session_start() problem, can you change to
var_dump(session_start());to make sure it’s working?Otherwise I’d be surprised if there was a problem with the library, but there’s little else that could be wrong.
Update
I think you need to actually create a page that uses securimage_show.php in an img tag, and call
session_start();at the top.Ie.