本文整理汇总了PHP中captcha::textual_riddle方法的典型用法代码示例。如果您正苦于以下问题:PHP captcha::textual_riddle方法的具体用法?PHP captcha::textual_riddle怎么用?PHP captcha::textual_riddle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类captcha
的用法示例。
在下文中一共展示了captcha::textual_riddle方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: form
function form($title = "→ retype that here", $more = "<small>Enter the correct letters and numbers from the image into the text box. This small test serves as access restriction against malicious bots. Simply reload the page if this graphic is too hard to read.</small>")
{
$pw = captcha::mkpass();
$hash = captcha::hash($pw);
$maxsize = strpos("MSIE", $_SERVER["HTTP_USER_AGENT"]) ? 3000 : 6000;
@header("Vary: User-Agent");
$img = "data:image/jpeg;base64," . base64_encode(captcha::image($pw, 200, 60, CAPTCHA_INVERSE, $maxsize));
$alt = htmlentities(captcha::textual_riddle($pw));
$html = '<table border="0" summary="captcha input"><tr>' . '<td><img name="captcha_image" id="captcha_image" src="' . $img . '" height="60" width="200" alt="' . $alt . '" /></td>' . '<td>' . $title . '<br/><input name="captcha_hash" type="hidden" value="' . $hash . '" />' . '<input name="captcha_input" type="text" size="7" maxlength="16" style="height:46px; font-size:34px; font-weight:450;" />' . '</td><td>' . $more . '</td>' . '</tr></table>';
$base = "http://{$_SERVER['SERVER_NAME']}:{$_SERVER['SERVER_PORT']}/" . substr(realpath(__FILE__), strlen($_SERVER["DOCUMENT_ROOT"]));
$html .= <<<END
<script language="Javascript"><!--
if (/Microsoft/.test(navigator.appName)) {
var img = document.captcha_image;
img.src = "{$base}?_ddu=" + img.src.substr(23);
} //--></script>
END;
$html = "<div class=\"captcha\">{$html}</div>";
return $html;
}