当前位置: 首页>>代码示例>>PHP>>正文


PHP PhpCaptcha::Create方法代码示例

本文整理汇总了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';
 }
开发者ID:alvsgithub,项目名称:Newscoop,代码行数:8,代码来源:NewscoopExtension.php

示例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();
 }
开发者ID:ralaxraja,项目名称:phlypheonix,代码行数:10,代码来源:captcha.php

示例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();
 }
开发者ID:ghlnv,项目名称:etalentos,代码行数:10,代码来源:CaptchaComponent.php

示例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();
 }
开发者ID:vsanth,项目名称:propertykon,代码行数:12,代码来源:captcha.php

示例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;
 }
开发者ID:altralize,项目名称:Paid4Catcher,代码行数:15,代码来源:actions.class.php

示例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)));
 }
开发者ID:sinfocol,项目名称:gwf3,代码行数:19,代码来源:Captcha.php

示例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);
}
开发者ID:sinfocol,项目名称:gwf3,代码行数:22,代码来源:crackcha.php

示例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();
开发者ID:habb0,项目名称:HabboPHP,代码行数:16,代码来源:captcha.php

示例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();
开发者ID:CatBerg-TestOrg,项目名称:coppermine_1.6.x,代码行数:27,代码来源:captcha.php

示例10: CaptchaCreate

 static function CaptchaCreate($size)
 {
     $v = new PhpCaptcha(null, 100, 50);
     $v->UseColour(true);
     $v->SetNumChars(4);
     $v->Create();
 }
开发者ID:caijinlin,项目名称:hackathon,代码行数:7,代码来源:Utility.class.php

示例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'));
开发者ID:heg-arc-ne,项目名称:cscart,代码行数:31,代码来源:image.php

示例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);
开发者ID:alencarmo,项目名称:OCF,代码行数:31,代码来源:captcha.php

示例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);
开发者ID:ylefebvre,项目名称:link-library,代码行数:19,代码来源:easycaptcha.php

示例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();
开发者ID:sourcefabric,项目名称:newscoop,代码行数:9,代码来源:image.php

示例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&amp;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;
}
开发者ID:Dolfanuk55,项目名称:Kingdoms,代码行数:31,代码来源:index.php


注:本文中的PhpCaptcha::Create方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。