Success"
."The captcha code entered was correct!"
."
";
} else {
echo "
Incorrect Code
"
."Incorrect captcha code, try again."
."
";
}
} else if (isset($_GET['display'])) {
// display the captcha with the supplied ID from the URL
// construct options specifying the existing captcha ID
// also tell securimage not to start a session
$options = array('captchaId' => $captchaId,
'no_session' => true);
$captcha = new Securimage($options);
// show the image, this sends proper HTTP headers
$captcha->show();
exit;
}
// generate a new captcha ID and challenge
$captchaId = Securimage::getCaptchaId();
// output the captcha ID, and a form to validate it
// the form submits to itself and is validated above
echo <<
Static Captcha Example
Static Captcha Example
Synopsis:
- Request new captchaId using Securimage::getCaptchaId()
- Display form with hidden field containing captchaId
- Display captcha image passing the captchaId to the image
- Validate captcha input against captchaId using Securimage::checkByCaptchaId()
Captcha ID: $captchaId
EOD;