本文整理汇总了PHP中Captcha::Set方法的典型用法代码示例。如果您正苦于以下问题:PHP Captcha::Set方法的具体用法?PHP Captcha::Set怎么用?PHP Captcha::Set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Captcha
的用法示例。
在下文中一共展示了Captcha::Set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: pic
public static function pic()
{
$captcha = Captcha::Get();
if ($captcha == 'Error') {
$captcha = Captcha::Set();
}
header("Content-Type: image/gif");
$im = @imagecreate(60, 22) or die("Cannot Initialize new GD image stream");
$background_color = imagecolorallocate($im, 255, 255, 255);
$text_color = imagecolorallocate($im, 0, 0, 0);
imagestring($im, 14, 2, 2, $captcha, $text_color);
imagepng($im);
imagedestroy($im);
}
示例2: do_main
function do_main()
{
global $ttH;
$data = array();
if ($ttH->site_func->check_user_login() == 1) {
return $this->do_address();
} else {
Captcha::Set();
$data['link_login_go'] = $ttH->site->get_link('product', $ttH->setting['product']['ordering_friendly_link'], $ttH->setting['product']['ordering_address_link']);
$data['form_signin'] = $ttH->html->temp_box('form_signin', array('link_root' => $ttH->conf['rooturl'], 'link_login_go' => $data['link_login_go']));
$data['form_signup'] = $ttH->html->temp_box('form_signup', array('link_root' => $ttH->conf['rooturl'], 'link_login_go' => $data['link_login_go']));
$ttH->temp_act->assign('data', $data);
$ttH->temp_act->parse("ordering_user");
return $ttH->temp_act->text("ordering_user");
}
}
示例3: do_signin
function do_signin()
{
global $ttH;
$output = array('ok' => 0, 'mess' => '');
if ($ttH->site_func->check_user_login() == 1) {
$output['ok'] = 1;
$output['mess'] = $ttH->lang['global']['signin_success'];
return json_encode($output);
}
$input_tmp = $ttH->post['data'];
foreach ($input_tmp as $key) {
$input[$key['name']] = $key['value'];
}
/*print_arr($input);
die('adasd');*/
$arr_check = array('username', 'password');
$arr_in = array();
foreach ($arr_check as $key) {
if (empty($output['mess']) && (!isset($input[$key]) || empty($input[$key]))) {
$output['mess'] = $ttH->lang['global']['err_invalid_' . $key];
break;
}
$arr_in[$key] = $input[$key];
}
if (empty($output['mess'])) {
$arr_in['password'] = $ttH->func->md25($arr_in['password']);
}
if (empty($output['mess'])) {
$query = "select user_id,username,password,session \n\t\t\t\t\t\t\t\tfrom user \n\t\t\t\t\t\t\t\twhere is_show=1 \n\t\t\t\t\t\t\t\tand username='" . $arr_in['username'] . "' \n\t\t\t\t\t\t\t\tand password='" . $arr_in['password'] . "' ";
$result = $ttH->db->query($query);
if ($row = $ttH->db->fetch_row($result)) {
Session::Set('user_cur', array('userid' => $row['user_id'], 'username' => $row['username'], 'password' => $row['password'], 'session' => $row['session']));
$output['ok'] = 1;
$output['mess'] = $ttH->lang['global']['signin_success'];
Captcha::Set();
} else {
$output['mess'] = $ttH->lang['global']['signin_false'];
}
}
return json_encode($output);
}