本文整理汇总了PHP中gcms::checkIDCard方法的典型用法代码示例。如果您正苦于以下问题:PHP gcms::checkIDCard方法的具体用法?PHP gcms::checkIDCard怎么用?PHP gcms::checkIDCard使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gcms
的用法示例。
在下文中一共展示了gcms::checkIDCard方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
<?php
// modules/member/checkidcard.php
header("content-type: text/html; charset=UTF-8");
// inint
include '../../bin/inint.php';
// referer
if (gcms::isReferer()) {
$id = gcms::getVars($_POST, 'id', 0);
$value = $db->sql_trim_str($_POST, 'value');
// phone
if ($config['member_idcard'] == 1 && $value == '') {
echo 'IDCARD_EMPTY';
} elseif ($value != '') {
if (!gcms::checkIDCard($value)) {
echo 'IDCARD_INVALID';
} else {
// ตรวจสอบ phone
$sql = "SELECT `id` FROM `" . DB_USER . "` WHERE `idcard`='{$value}' LIMIT 1";
$search = $db->customQuery($sql);
if (sizeof($search) == 1 && ($id == 0 || $id != $search[0]['id'])) {
echo 'IDCARD_EXISTS';
}
}
}
}
示例2: elseif
$search = $db->customQuery($sql);
if (sizeof($search) == 1) {
$ret['ret_register_phone'] = 'PHONE_EXISTS';
$input = !$input ? 'register_phone' : $input;
$error = !$error ? 'PHONE_EXISTS' : $error;
} else {
$ret['ret_register_phone'] = '';
}
} elseif ($config['member_phone'] == 2) {
$ret['ret_register_phone'] = 'PHONE_EMPTY';
$input = !$input ? 'register_phone' : $input;
$error = !$error ? 'PHONE_EMPTY' : $error;
}
// idcard
if ($save['idcard'] != '') {
if (!gcms::checkIDCard($save['idcard'])) {
$ret['ret_register_idcard'] = 'IDCARD_INVALID';
$input = !$input ? 'register_idcard' : $input;
$error = !$error ? 'IDCARD_INVALID' : $error;
} else {
// ตรวจสอบ idcard ซ้ำ
$sql = "SELECT `id` FROM `" . DB_USER . "` WHERE `idcard`='{$save['idcard']}' LIMIT 1";
$search = $db->customQuery($sql);
if (sizeof($search) == 1) {
$ret['ret_register_idcard'] = 'IDCARD_EXISTS';
$input = !$input ? 'register_idcard' : $input;
$error = !$error ? 'IDCARD_EXISTS' : $error;
} else {
$ret['ret_register_idcard'] = '';
}
}