本文整理汇总了PHP中PhpCaptcha::Create方法的典型用法代码示例。如果您正苦于以下问题:PHP PhpCaptcha::Create方法的具体用法?PHP PhpCaptcha::Create怎么用?PHP PhpCaptcha::Create使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhpCaptcha
的用法示例。
在下文中一共展示了PhpCaptcha::Create方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getReCaptchaImage
public function getReCaptchaImage()
{
$fontsDirectory = __DIR__ . '/../../../../include/captcha/';
$aFonts = array($fontsDirectory . 'fonts/VeraBd.ttf', $fontsDirectory . 'fonts/VeraIt.ttf', $fontsDirectory . 'fonts/Vera.ttf');
$oVisualCaptcha = new \PhpCaptcha($aFonts, 200, 60);
$oVisualCaptcha->Create(__DIR__ . '/../../../../images/cache/recaptcha.png');
return '/images/cache/recaptcha.png';
}
示例2: image
function image()
{
$imagesPath = realpath(VENDORS . 'phpcaptcha') . '/fonts/';
$aFonts = array($imagesPath . 'VeraBd.ttf', $imagesPath . 'VeraIt.ttf', $imagesPath . 'Vera.ttf');
$oVisualCaptcha = new PhpCaptcha($aFonts, 200, 60);
$oVisualCaptcha->UseColour(true);
//$oVisualCaptcha->SetOwnerText('Source: '.FULL_BASE_URL);
$oVisualCaptcha->SetNumChars(6);
$oVisualCaptcha->Create();
}
示例3: image
function image()
{
$imagesPath = ROOT . DS . APP_DIR . DS . 'Vendor' . DS . 'PhpCaptcha' . DS . 'fonts' . DS;
$aFonts = array($imagesPath . 'VeraBd.ttf', $imagesPath . 'VeraIt.ttf', $imagesPath . 'Vera.ttf');
$oVisualCaptcha = new PhpCaptcha($aFonts, 200, 60);
$oVisualCaptcha->UseColour(true);
//$oVisualCaptcha->SetOwnerText('Source: '.FULL_BASE_URL);
$oVisualCaptcha->SetNumChars(6);
$oVisualCaptcha->Create();
}
示例4: image
function image()
{
$imagesPath = APP . 'vendors' . DS . 'phpcaptcha' . '/fonts/';
$aFonts = array($imagesPath . 'VeraBd.ttf', $imagesPath . 'VeraIt.ttf', $imagesPath . 'Vera.ttf');
$oVisualCaptcha = new PhpCaptcha($aFonts, 220, 60);
$oVisualCaptcha->UseColour(true);
$oVisualCaptcha->SetNumLines(false);
$oVisualCaptcha->DisplayShadow(false);
//$oVisualCaptcha->SetOwnerText('Source: '.FULL_BASE_URL);
$oVisualCaptcha->SetNumChars(5);
$oVisualCaptcha->Create();
}
示例5: executeImage
public function executeImage()
{
$theme = sfConfig::get("app_phpcaptcha_theme", "Small");
if (class_exists("PHPCaptcha" . $theme . "Theme")) {
eval("\$theme = new PHPCaptcha" . $theme . "Theme();");
} else {
$theme = new PHPCaptchaSmallTheme();
}
$oVisualCaptcha = new PhpCaptcha($theme);
$oVisualCaptcha->setOwnerText(sfConfig::get("app_phpcaptcha_ownertext", ""));
$oVisualCaptcha->setHeight(sfConfig::get("app_phpcaptcha_height", $theme->getOption('height')));
$oVisualCaptcha->setWidth(sfConfig::get("app_phpcaptcha_width", $theme->getOption('width')));
$oVisualCaptcha->Create();
return sfView::NONE;
}
示例6: execute
public function execute()
{
# Don't store this url.
GWF3::setConfig('store_last_url', false);
# Load the Captcha class
require GWF_CORE_PATH . 'inc/3p/Class_Captcha.php';
# disable Logging
GWF3::setConfig('log_request', false);
# disable HTTP Caching
GWF_HTTP::noCache();
# Setup Font, Color, Size
$aFonts = $this->module->cfgCaptchaFont();
$rgbcolor = $this->module->cfgCaptchaBG();
$width = $this->module->cfgCaptchaWidth();
$height = $this->module->cfgCaptchaHeight();
$oVisualCaptcha = new PhpCaptcha($aFonts, $width, $height, $rgbcolor);
# Output the captcha
die($oVisualCaptcha->Create('', Common::getGetString('chars', true)));
}
示例7: crackcha_next
function crackcha_next(WC_Challenge $chall)
{
if (crackcha_round_over()) {
header('Content-Type: text/plain');
if (false === crackcha_insert_high($chall)) {
echo GWF_HTML::lang('ERR_DATABASE', array(__FILE__, __LINE__));
return;
} else {
echo $chall->lang('msg_insert_high') . PHP_EOL;
echo crackcha_reset($chall);
return;
}
}
require_once GWF_CORE_PATH . 'inc/3p/Class_Captcha.php';
$chars = GWF_Random::randomKey(5, GWF_Random::ALPHAUP);
crackcha_increase_count();
GWF_Session::set('WCC_CRACKCHA_CHARS', $chars);
$aFonts = array(GWF_PATH . 'extra/font/teen.ttf');
$rgbcolor = GWF_CAPTCHA_COLOR_BG;
$oVisualCaptcha = new PhpCaptcha($aFonts, 210, 42, $rgbcolor);
$oVisualCaptcha->Create('', $chars);
}
示例8: array
<?php
/********************************************************************************
MachForm
Copyright 2007-2012 Appnitro Software. This code cannot be redistributed without
permission from http://www.appnitro.com/
More info at: http://www.appnitro.com/
********************************************************************************/
header("p3p: CP=\"IDC DSP COR ADM DEVi TAIi PSA PSD IVAi IVDi CONi HIS OUR IND CNT\"");
session_start();
require 'lib/php-captcha/php-captcha.inc.php';
$fonts = array('lib/php-captcha/VeraSeBd.ttf', 'lib/php-captcha/VeraBd.ttf');
$captcha = new PhpCaptcha($fonts, 200, 60);
$captcha->Create();
示例9: Copyright
<?php
/*************************
Coppermine Photo Gallery
************************
Copyright (c) 2003-2014 Coppermine Dev Team
v1.0 originally written by Gregory Demar
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License version 3
as published by the Free Software Foundation.
********************************************
Coppermine version: 1.6.01
$HeadURL$
$Revision$
**********************************************/
define("IN_COPPERMINE", true);
require "include/init.inc.php";
require "include/captcha.inc.php";
/**
* Fonts to create the captcha image
*/
$aFonts = array('images/fonts/acidic.ttf', 'images/fonts/hurryup.ttf');
// create new image
$oPhpCaptcha = new PhpCaptcha($aFonts, 150, 30, 5, 20, false);
$oPhpCaptcha->Create();
示例10: CaptchaCreate
static function CaptchaCreate($size)
{
$v = new PhpCaptcha(null, 100, 50);
$v->UseColour(true);
$v->SetNumChars(4);
$v->Create();
}
示例11: elseif
$c->DisplayShadow(true);
}
if ($verification_settings['colour'] == 'Y') {
$c->UseColour(true);
}
if ($verification_settings['string_type'] == 'digits') {
$c->SetCharSet(array(2, 3, 4, 5, 6, 8, 9));
} elseif ($verification_settings['string_type'] == 'letters') {
$c->SetCharSet(range('A', 'F'));
} else {
$c->SetCharSet(fn_array_merge(range('A', 'F'), array(2, 3, 4, 5, 6, 8, 9), false));
}
if (!empty($verification_settings['background_image'])) {
$c->SetBackgroundImages(fn_get_files_dir_path() . $verification_settings['background_image']);
}
$c->Create();
exit;
} elseif ($mode == 'custom_image') {
if (empty($_REQUEST['image'])) {
exit;
}
$type = empty($_REQUEST['type']) ? 'T' : $_REQUEST['type'];
$image_path = 'sess_data/' . fn_basename($_REQUEST['image']);
if (Storage::instance('custom_files')->isExist($image_path)) {
$real_path = Storage::instance('custom_files')->getAbsolutePath($image_path);
list(, , $image_type, $tmp_path) = fn_get_image_size($real_path);
if ($type == 'T') {
$thumb_path = $image_path . '_thumb';
if (!Storage::instance('custom_files')->isExist($thumb_path)) {
// Output a thumbnail image
list($cont, $format) = fn_resize_image($tmp_path, Registry::get('settings.Thumbnails.product_lists_thumbnail_width'), Registry::get('settings.Thumbnails.product_lists_thumbnail_height'), Registry::get('settings.Thumbnails.thumbnail_background_color'));
示例12: array
<?php
/**
* Coppermine Photo Gallery
*
* Copyright (c) 2003-2006 Coppermine Dev Team
* v1.1 originally written by Gregory DEMAR
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* Coppermine version: 1.4.13
* CAPTCHA Plugin
* Based on Mod by Abbas ali(http://coppermine-gallery.net/forum/index.php?topic=29564.0)
* Plugin Writen by bmossavari at gmail dot com
*/
define("IN_COPPERMINE", true);
require 'include/init.inc.php';
/**
* Fonts to create the captch image
*/
$aFonts = array('plugins/captcha/fonts/acidic.ttf', 'plugins/captcha/fonts/hurryup.ttf');
// create new image
$oPhpCaptcha = new PhpCaptcha($aFonts, 145, 45, 5, 70, false, $sOwnerText = 'Coppermine Captcha v3.0', $aCharSet = array(), $sBackgroundImage = '');
$code = $oPhpCaptcha->Create();
$ip = $_SERVER['REMOTE_ADDR'];
// add user ip and captcha code to captcha table
$query = "INSERT INTO {$CONFIG['TABLE_PREFIX']}plugin_captcha (time,ip_addr,code) VALUES (NOW(),'{$ip}','{$code}')";
cpg_db_query($query);
示例13: array
<?php
require 'php-captcha.inc.php';
$fonts = array('', 'Bd', 'BI', 'It', 'MoBd', 'MoBI', 'MoIt', 'Mono', 'Se', 'SeBd');
for ($i = 0; $i < count($fonts); $i++) {
$fonts[$i] = 'ttf-bitstream-vera-1.10/Vera' . $fonts[$i] . '.ttf';
}
$alphabet = 'a_b_c_d_e_f_g_h_i_j_k_l_m_n_o_p_q_r_s_t_u_v_w_x_y_z';
$alphabet = explode('_', $alphabet);
shuffle($alphabet);
$captchaText = '';
for ($i = 0; $i < 5; $i++) {
$captchaText .= $alphabet[$i];
}
$time = time();
setcookie('Captcha', md5("ORHFUKELFPTUEODKFJ" . $captchaText . $_SERVER['REMOTE_ADDR'] . $time) . '.' . $time, null, '/');
$oVisualCaptcha = new PhpCaptcha($fonts, strlen($captchaText) * 23, 60);
$oVisualCaptcha->UseColour(true);
$oVisualCaptcha->Create($captchaText);
示例14: array
<?php
session_start();
require 'php-captcha.inc.php';
$aFonts = array('fonts/VeraBd.ttf', 'fonts/VeraIt.ttf', 'fonts/Vera.ttf');
$oVisualCaptcha = new PhpCaptcha($aFonts, 200, 60);
//$oVisualCaptcha->SetBackgroundImages(array('capback1.jpg', 'capback2.jpg'));
//$oVisualCaptcha->SetFontColorRange(120, 255);
$oVisualCaptcha->Create();
示例15: die
// Get latest posts..
$query = mysql_query("SELECT * FROM " . $database['prefix'] . "blogs \n ORDER BY id DESC \n LIMIT " . $SETTINGS->rssfeeds . "\n ") or die(mysql_error());
while ($RSS = mysql_fetch_object($query)) {
$rss_feed .= $MW_FEED->add_item($msg_rss3 . $RSS->title, $SETTINGS->modR ? $SETTINGS->w_path . '/blog/' . $RSS->id . '/' . addTitleToUrl(cleanData($RSS->title)) . '.html' : $SETTINGS->w_path . '/index.php?cmd=blog&post=' . $RSS->id, $RSS->rss_date ? $RSS->rss_date : $build_date, $RSS->comments);
}
// Close channel..
$rss_feed .= $MW_FEED->close_channel();
// Display RSS feed..
header('Content-Type: text/xml');
echo get_magic_quotes_gpc() ? stripslashes(trim($rss_feed)) : trim($rss_feed);
break;
//==================
// Case : Captcha
//==================
//==================
// Case : Captcha
//==================
case 'captcha':
$MWC = new PhpCaptcha();
$MWC->Create();
break;
//==============
// Default
//==============
//==============
// Default
//==============
default:
header("Location: index.php");
break;
}