session_start();
$captcha_id = substr(session_id(), 0, 15);
?>
Please enter the text from the picture:
if ($_POST['captcha_answer']) {
// remove anything except letters and numbers (security)
$answer = preg_replace('/[^a-z0-9]+/i', '', $_POST['captcha_answer']);
$verify_link = "http://captcha.kie.sk/verify.php?captcha_id=" . $captcha_id . "&captcha_answer=" . $answer;
$result = implode(file($verify_link));
$found = strstr($result, "OK");
if ($found !== FALSE) {
echo 'Answer correct!
';
} else {
echo 'Wrong answer, please try again.
';
}
}
?>