本文整理汇总了PHP中captcha::get方法的典型用法代码示例。如果您正苦于以下问题:PHP captcha::get方法的具体用法?PHP captcha::get怎么用?PHP captcha::get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类captcha
的用法示例。
在下文中一共展示了captcha::get方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: exit
<?php
/**
* [Discuz!] (C)2001-2099 Comsenz Inc.
* This is NOT a freeware, use is subject to license terms
*
* $Id: get.inc.php 33997 2013-09-17 06:46:37Z nemohou $
*/
if (!defined('IN_DISCUZ')) {
exit('Access Denied');
}
$data = captcha::get($_GET['refresh'], $_GET['modid']);
preg_match('/verifysession=(\\w+);/', $GLOBALS['filesockheader'], $r);
dsetcookie('dcaptchasig', $r[1]);
dheader('Content-Disposition: inline');
dheader('Content-Type: image/pjpeg');
echo $data;
示例2: render
/**
* Renders a participation form. This form is ready to be echo'ed in your template
*/
function render()
{
global $thinkedit;
// add content
$this->form->add('<h1>');
$this->form->add($this->title);
$this->form->add('</h1>');
// In all cases, build form UI
foreach ($this->content->field as $field) {
if ($field->isUsedIn('participation') && $field->getType() != 'id') {
$this->form->add('<div class="participation_field">');
$this->form->add('<div class="participation_field_title">');
if ($field->isRequired() || $field->isTitle()) {
$this->form->add('<span class="participation_field_required">*</span>');
}
$this->form->add($field->getTitle() . ' : ');
$this->form->add('</div>');
if ($field->getHelp()) {
$this->form->add('<div class="participation_field_help">');
$this->form->add($field->getHelp());
$this->form->add('</div>');
}
if ($this->form->isSent() && $field->getErrorMessage()) {
$this->form->add('<div class="participation_field_error">');
$this->form->add($field->getErrorMessage());
$this->form->add('</div>');
}
$this->form->add('<div class="participation_field_ui">');
$this->form->add($field->renderUi());
$this->form->add('</div>');
$this->form->add('</div>');
}
}
// add captcha if needed
if ($this->enable_captcha) {
require_once ROOT . '/class/captcha.class.php';
$captcha = new captcha();
$this->form->add('<div class="participation_field">');
$this->form->add('<div class="participation_field_title">');
$this->form->add('<span class="participation_field_required">*</span>');
$this->form->add($this->captcha_title);
$this->form->add('</div>');
$this->form->add('<div class="participation_field_help">');
$this->form->add($this->captcha_help);
$this->form->add('</div>');
if ($this->form->isSent()) {
if (isset($_REQUEST['captcha']) && $_REQUEST['captcha'] != $captcha->get()) {
$this->form->add('<div class="participation_field_error">');
$this->form->add($this->captcha_error);
$this->form->add('</div>');
$captcha->reset();
}
}
if (isset($_REQUEST['captcha'])) {
$captcha_entered = $_REQUEST['captcha'];
} else {
$captcha_entered = '';
}
$this->form->add('<div class="participation_field_ui">');
$this->form->add('<br/>');
$this->form->add('<img src="' . $captcha->render() . '">');
$this->form->add('<br/> <br/>');
$this->form->add('Code : <input type="text" name="captcha" value="' . $captcha_entered . '">');
$this->form->add('</div>');
$this->form->add('</div>');
}
return $this->form->render();
}
示例3: clean
}
// clean les infos http://www.phpsecure.info/v2/article/MailHeadersInject.php
function clean($value)
{
if (eregi("\r", $value) || eregi("\n", $value)) {
die("Why ?? :(");
}
$value = preg_replace("/\r/", "", $value);
$value = preg_replace("/\n/", "", $value);
return $value;
}
// génération support captcha
require_once ROOT . '/class/captcha.class.php';
$captcha = new captcha();
// vérif captcha
if ($captcha->get() != $_REQUEST['captcha']) {
die('code invalide, utilisez le bouton "précédent" de votre navigateur pour corriger le code');
} else {
$captcha->reset();
$from_email = $_SESSION['ecard']['from_email'];
$from_name = $_SESSION['ecard']['from_name'];
$to_email = $_SESSION['ecard']['to_email'];
$subject = 'Voici une carte postale';
$message = $_SESSION['ecard']['message'] . ' - ' . $_SESSION['ecard']['from_name'] . ' (' . $_SESSION['ecard']['from_email'] . ') ';
$image = $thinkedit->newFilesystem();
$image->setPath($_SESSION['ecard']['image']);
$template = $thinkedit->newFilesystem();
$template->setPath($_SESSION['ecard']['template']);
$ecard_attachement = draw_card($message, $template->getRealPath(), $image->getRealPath(), true);
// fabrique le mail
require_once 'class.phpmailer.php';