Example #1
0
<?php

/**
 * [Weizan System] Copyright (c) 2014 012WZ.COM
 * Weizan is NOT a free software, it under the license terms, visited http://www.012wz.com/ for more details.
 */
defined('IN_IA') or exit('Access Denied');
error_reporting(0);
load()->classs('captcha');
session_start();
$captcha = new Captcha();
$captcha->build(150, 40);
$hash = md5(strtolower($captcha->phrase) . $_W['config']['setting']['authkey']);
isetcookie('__code', $hash);
$_SESSION['__code'] = $hash;
$captcha->output();
<?php

require '../../lib/Config.php';
Config::init();
$captcha = new Captcha();
$captcha->build();
$app = new ServerApp();
$auth_service = $app->getAuthService();
$auth_service->setCaptchaText($captcha->getCaptchaText());
$captcha->sendImage();