本文整理汇总了PHP中simple_php_captcha函数的典型用法代码示例。如果您正苦于以下问题:PHP simple_php_captcha函数的具体用法?PHP simple_php_captcha怎么用?PHP simple_php_captcha使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了simple_php_captcha函数的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: faucet_get_captcha
function faucet_get_captcha($SETTINGS)
{
if ($SETTINGS->get("use_captcha")) {
//Settings to pass to captcha functions
$captcha_config = array();
//Load Captcha HTML
if ($SETTINGS->get("captcha") == "simple-captcha") {
//Load simple captcha library
$simplecaptcha = './libraries/simple-captcha/simple-php-captcha.php';
require_once $simplecaptcha;
$captcha_config['session_name'] = $SETTINGS->config["captcha_config"]["simple_captcha_session_name"];
@session_name($captcha_config['session_name']);
@session_start();
$_SESSION['captcha'] = simple_php_captcha($captcha_config);
// set a new CAPTCHA
return isset($_SESSION['captcha']) ? '<img src="' . $simplecaptcha . $_SESSION['captcha']["image_request"] . '" alt="[captcha]"/>' : '';
} elseif ($SETTINGS->get("captcha") == "solvemedia") {
//Load solvemedia library
require_once './libraries/solvemedialib.php';
$captcha_config['solvemedia_challenge_key'] = $SETTINGS->config["captcha_config"]["solvemedia_challenge_key"];
return solvemedia_get_html($captcha_config["solvemedia_challenge_key"]);
} elseif ($SETTINGS->get("captcha") == "recaptcha") {
//Load re-captcha library
require_once './libraries/recaptchalib.php';
$captcha_config['recpatcha_public_key'] = $SETTINGS->config["captcha_config"]["recpatcha_public_key"];
return recaptcha_get_html($captcha_config["recpatcha_public_key"]);
}
} else {
return '';
//Emtpy
}
}
示例2: init
/**
* init library
* @require
*/
public function init()
{
@session_start();
if (function_exists('simple_php_captcha')) {
$_SESSION['captcha'] = simple_php_captcha($this->options);
}
return isset($_SESSION['captcha']) ? $_SESSION['captcha'] : '';
}
示例3: session_start
<?php
session_start();
if ($_SESSION['id']) {
include "ajax/simple-php-captcha.php";
$_SESSION['captcha'] = simple_php_captcha();
?>
<div class="col-md-8">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Panel de control</h3>
</div>
<div class="panel-group">
<div class="panel panel-default" style="width:90%; margin-left:5%; margin-top:5px; font-size:11px;">
<div class="panel-heading">
<h4 class="panel-title">
<button class="btn btn-warning btn-xs" style="width:200px;" data-toggle="collapse" href="#collapse1">Mover Personaje</button>
</h4>
</div>
<div id="collapse1" class="panel-collapse collapse">
<div class="panel-body">
<div class="text">El personaje sera reinstaurado en el centro de la ciudad correspontiente a tu reino.</div>
<form action="index.php?s=usercp" method="get" class="form-inline">
<div class="form-group">
<div class="text">Personajes</label>
<select name="pid" id="pid" class="">
<?php
$pj = new user_panel();
echo $pj->getplayers($_SESSION['id']);
?>
示例4: simple_php_captcha
<textarea maxlength="5000" data-msg-required="Por favor deje su mensaje." rows="6" class="form-control" name="message" id="message" required></textarea>
</div>
</div>
</div>
<div class="row">
<div class="col-md-12">
<label>Verificación *</label>
</div>
</div>
<div class="row">
<div class="form-group">
<div class="col-md-4">
<div class="captcha form-control">
<div class="captcha-image">
<?php
$_SESSION['captcha'] = simple_php_captcha(array('min_length' => 6, 'max_length' => 6, 'min_font_size' => 22, 'max_font_size' => 22, 'angle_max' => 3));
$_SESSION['captchaCode'] = $_SESSION['captcha']['code'];
echo '<img id="captcha-image" src="' . "php/simple-php-captcha/simple-php-captcha.php/" . $_SESSION['captcha']['image_src'] . '" alt="CAPTCHA code">';
?>
</div>
<div class="captcha-refresh">
<a href="#" id="refreshCaptcha"><i class="fa fa-refresh"></i></a>
</div>
</div>
</div>
<div class="col-md-8">
<input type="text" value="" maxlength="6" data-msg-captcha="Error de código de verificación." data-msg-required="Introduzca una verificación válida." placeholder="Introduzca el codigo." class="form-control input-lg captcha-input" name="captcha" id="captcha" required>
</div>
</div>
</div>
<div class="row">
示例5: __construct
//.........这里部分代码省略.........
}
// ---
if (isset($config["rpc_user"], $config["rpc_password"], $config["rpc_host"], $config["rpc_port"], $config["mysql_user"], $config["mysql_password"], $config["mysql_host"], $config["mysql_database"])) {
if (class_exists("jsonRPCClient")) {
$this->rpc_client = new jsonRPCClient('http://' . urlencode($config["rpc_user"]) . ':' . urlencode($config["rpc_password"]) . '@' . urlencode($config["rpc_host"]) . ':' . urlencode($config["rpc_port"]));
$this->db = @new mysqli($config["mysql_host"], $config["mysql_user"], $config["mysql_password"], $config["mysql_database"]);
//if (!$this->db->connect_error)
if (!mysqli_connect_error() && !is_null($this->balance = $this->rpc("getbalance"))) {
$this->total_donated = $this->rpc("getreceivedbyaddress", array($this->config["donation_address"]));
if ($this->balance >= $this->config["payout_threshold"]) {
$this->status = SF_STATUS_OPERATIONAL;
if ($this->config["use_captcha"] && $this->config["captcha"] == "simple-captcha") {
@session_name("dgsfauc");
@session_start();
//$_SESSION['captcha'] = simple_php_captcha($this->config["captcha_config"]);
}
if (isset($_POST["kittehcoin_address"]) && ($this->config["use_captcha"] && $this->valid_captcha() || !$this->config["use_captcha"])) {
$kittehcoin_address = $_POST["kittehcoin_address"];
$validation = $this->rpc("validateaddress", array($kittehcoin_address));
if ($validation["isvalid"]) {
$interval = "7 HOUR";
// hardcoded default interval if the custom interval is messed up
$interval_value = intval(substr($this->config["payout_interval"], 0, -1));
$interval_function = strtoupper(substr($this->config["payout_interval"], -1));
if ($interval_value >= 0 && ($interval_function == "H" || $interval_function == "M" || $interval_function == "D")) {
$interval = $interval_value . " ";
switch ($interval_function) {
case "M":
$interval .= "MINUTE";
break;
case "H":
$interval .= "HOUR";
break;
case "D":
$interval .= "DAY";
break;
}
}
$ch = curl_init("https://www.dan.me.uk/torlist/");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$text = curl_exec($ch);
$test = strpos($text, $_SERVER["REMOTE_ADDR"]);
if ($test == false) {
$user_check = " AND (";
if ($this->config["user_check"] == "ip_address" || $this->config["user_check"] == "both") {
$user_check .= " `ip_address` = '" . $this->db->escape_string($_SERVER["REMOTE_ADDR"]) . "'";
}
if ($this->config["user_check"] == "kitteh_address" || $this->config["user_check"] == "both") {
$user_check .= ($this->config["user_check"] == "both" ? " OR" : "") . " `payout_address` = '" . $this->db->escape_string($kittehcoin_address) . "'";
}
$user_check .= ")";
$result = $this->db->query("SELECT `id` FROM `" . $this->db->escape_string($this->config["mysql_table_prefix"]) . "payouts` WHERE `timestamp` > NOW() - INTERVAL " . $interval . $user_check);
if ($row = $result->fetch_assoc()) {
$this->status = SF_STATUS_PAYOUT_DENIED;
} else {
$this->payout_amount = mt_rand($this->config["minimum_payout"] * 10000, $this->config["maximum_payout"] * 10000) / 10000;
// calculate a random MEOW amount
$this->db->query("INSERT INTO `" . $this->db->escape_string($this->config["mysql_table_prefix"]) . "payouts` (`payout_amount`,`ip_address`,`payout_address`,`timestamp`) VALUES ('" . $this->payout_amount . "','" . $this->db->escape_string($_SERVER["REMOTE_ADDR"]) . "','" . $this->db->escape_string($kittehcoin_address) . "',NOW())");
// insert the transaction into the payout log
if ($this->config["wallet_passphrase"] != "") {
$this->rpc("walletpassphrase", array($this->config["wallet_passphrase"], 4));
}
// unlock wallet
$this->status = !is_null($this->rpc("sendtoaddress", array($kittehcoin_address, $this->payout_amount))) ? SF_STATUS_PAYOUT_ACCEPTED : SF_STATUS_PAYOUT_ERROR;
// send the MEOW
if ($this->config["wallet_passphrase"] != "") {
$this->rpc("walletlock");
}
// lock wallet
}
} else {
$this->status = SF_STATUS_BANNED_IP;
}
} else {
$this->status = SF_STATUS_INVALID_KITTEH_ADDRESS;
}
} else {
if ($this->config["use_captcha"] && $this->config["captcha"] == "simple-captcha") {
$_SESSION['captcha'] = simple_php_captcha($this->config["captcha_config"]);
}
// set a new CAPTCHA
if (isset($_POST["kittehcoin_address"])) {
$this->status = SF_STATUS_CAPTCHA_INCORRECT;
}
}
} else {
$this->status = SF_STATUS_DRY_FAUCET;
}
} else {
$this->status = SF_STATUS_MYSQL_CONNECTION_FAILED;
}
} else {
$this->status = SF_STATUS_FAUCET_INCOMPLETE;
}
// missing RPC client
} else {
$this->status = SF_STATUS_FAUCET_INCOMPLETE;
}
// missing some settings
}
示例6: draw
function draw()
{
if (User::is_login()) {
Url::redirect_url(STATIC_URL);
}
global $display;
$this->beginForm(true, "post", false);
require_once ROOT_PATH . 'includes/captcha/simple-php-captcha.php';
$_SESSION['captcha'] = simple_php_captcha();
$display->add('captcha', 'http://' . $_SERVER['HTTP_HOST'] . $_SESSION['captcha']['image_src']);
$error_message = $this->getErrorMessage('dangky');
if ($error_message != '') {
$display->add('user_name', trim(Url::get('user_name', '')));
}
$display->add('error_message', $error_message);
$display->output('Register');
$this->endForm();
}
示例7: base_url
<div class="modal fade" id="basicModal" tabindex="-1" role="dialog" aria-labelledby="basicModal" aria-hidden="true">
<div class="modal-dialog">
<button type="button" class="btn btn-default" data-dismiss="modal">X</button>
<div class="modal-content">
<div class="login-head"><i class="fa fa-lock"></i> login</div>
<form class="col-md-12" id="loginform" action="<?php
echo base_url();
?>
users/login" method="post">
<?php
include dirname(dirname(dirname(dirname(__FILE__)))) . '/captcha/simple-php-captcha.php';
//ob_start();
//session_start();
//$_SESSION = array();
$_SESSION['captcha'] = simple_php_captcha();
$captcha = array('captcha' => simple_php_captcha());
$this->session->set_userdata($captcha);
$captcha_d = $this->session->userdata('captcha');
//pr($captcha_d);
?>
<div class="login-left">
<div class="form-group">
<div class="form-control">
<span class="error-msg error_message" style="display: none" id="error_username">Please enter your username</span>
<span class="error-msg error_message" style="display: none" id="error_login_fail"></span>
<span><i class="fa fa-user"></i></span>
<input type="text" id="username" name="username" class="input-lg" placeholder="Username">
</div>
</div>
<div class="form-group">
示例8: session_start
<?php
session_start();
include "simple-php-captcha.php";
$_SESSION['captcha'] = simple_php_captcha(array('min_length' => 5, 'max_length' => 5, 'backgrounds' => array('white.png'), 'shadow_offset_x' => -1, 'shadow_offset_y' => 1));
echo $_SESSION['captcha']['image_src'];
示例9: createCaptcha
/**
* @return SimplePhpCaptcha
* @throws \Exception
*/
public function createCaptcha()
{
$_SESSION[sha1(__CLASS__)] = \simple_php_captcha();
return $this;
}
示例10: mail
<div class="wrap_form">
<?php
if (isset($_POST['submit1'])) {
if (!empty($_POST['captchacode'])) {
if (strtolower($_SESSION['captcha']['code']) == strtolower($_POST['captchacode'])) {
mail($destino, $asunto, $mensaje, $cabeceras);
$warning1 = '<div class="aviso2"> ' . _('Your message was sent successfully. Thanks.') . ' </div>';
} else {
$warning1 = '<div class="aviso1"> ' . _('Validation errors occurred. Please confirm the fields and submit it again.') . '</div>';
}
} else {
$warning2 = '<div class="aviso1">' . _('Validation errors occurred. Please confirm the fields and submit it again.') . '</div>';
}
}
$_SESSION['captcha'] = simple_php_captcha(array('min_length' => 5, 'max_length' => 5, 'backgrounds' => array('backgrounds/white-wave_p.png'), 'min_font_size' => 21, 'max_font_size' => 21, 'color' => '#dadada', 'angle_min' => 0, 'angle_max' => 5, 'shadow' => false, 'shadow_color' => '#fff', 'shadow_offset_x' => 0, 'shadow_offset_y' => 0));
?>
<form class="all_form" method="post" action="index.php" autocomplete="off">
<div class="contacto_titulo">
<?php
echo _('CONTACT FORM');
?>
</div>
<div class="group_form three">
<label>Nombre:</label>
<input name="nombre" type="text" placeholder='<?php
echo _('Name');
?>
' class="reset_form style_textinput"/>
示例11: switch
<?php
include "simple-php-captcha.php";
if (isset($_GET["action"])) {
switch ($_GET["action"]) {
case "get_captcha":
$captcha = array();
$captcha = simple_php_captcha();
break;
}
}
exit(json_encode($captcha));