本文整理匯總了PHP中CCaptcha::testCode方法的典型用法代碼示例。如果您正苦於以下問題:PHP CCaptcha::testCode方法的具體用法?PHP CCaptcha::testCode怎麽用?PHP CCaptcha::testCode使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CCaptcha
的用法示例。
在下文中一共展示了CCaptcha::testCode方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: stripslashes
$code = (!empty($_GET['code'])) ? stripslashes($_GET['code']) : "";
$categorie = (!empty($_GET['date'])) ? 19 : 18;
$id_groupe = CUserGroupe::get_default_groupe();
/*---------------------------------------------------------------------
INITIALISATION
----------------------------------------------------------------------*/
$msgerreur = "Erreur. Certains champs sont mal remplis";
$msgerreur2 = "Erreur sur pays";
$msgconfirm = "OK";
$msginfo = "";
require_once '../../../../../obj/CCaptcha.php';
session_start();
if (!CCaptcha::testCode($code)) {
echo 'NOT_SECURE';
exit(0);
}
/*---------------------------------------------------------------------
ENVOI
----------------------------------------------------------------------*/
if(!$nom || !$prenom || !$ville || !$pays || !$expediteur || !$expediteur) {
$msginfo = $msgerreur;
echo utf8_encode("<span class='error'>" . $msginfo . "</span>");
exit;
}
else {
$idcom = CCom::recupnomCom('commune', 'id_com', 'nom_com', $ville);
示例2: include
include("../inc/init.php");
/*---------------------------------------------------------------------
INITIALISATION
----------------------------------------------------------------------*/
$msgerreur = "Erreur. Certains champs sont mal remplis";
$msgconfirm = "OK";
$msginfo = "";
/*---------------------------------------------------------------------
TEST DE SECURITE
----------------------------------------------------------------------*/
require_once '../../../../../obj/CCaptcha.php';
session_start();
if (!CCaptcha::testCode($_REQUEST['code'])) {
echo 'NOT_SECURE';
exit(0);
}
/*---------------------------------------------------------------------
RECUPERATION
----------------------------------------------------------------------*/
$id_page = !empty($_REQUEST['id_page']) ? $_REQUEST['id_page'] : "";
/*---------------------------------------------------------------------
TRAITEMENTS
----------------------------------------------------------------------*/
$sql1 = "SELECT * FROM question WHERE etat = 1 ORDER BY id";
$res = CBdd::select($sql1);