本文整理汇总了PHP中gcms::ckClean方法的典型用法代码示例。如果您正苦于以下问题:PHP gcms::ckClean方法的具体用法?PHP gcms::ckClean怎么用?PHP gcms::ckClean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gcms
的用法示例。
在下文中一共展示了gcms::ckClean方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: header
<?php
// admin/mailto.php
header("content-type: text/html; charset=UTF-8");
// inint
include '../bin/inint.php';
$ret = array();
// ตรวจสอบ referer และ สมาชิก
if (gcms::isReferer() && gcms::isMember()) {
if (isset($_SESSION['login']['account']) && $_SESSION['login']['account'] == 'demo') {
$ret['error'] = 'EX_MODE_ERROR';
} else {
// ค่าที่ส่งมา
$topic = htmlspecialchars(trim($_POST['email_subject']));
$detail = gcms::ckClean($_POST['email_detail']);
$reciever = htmlspecialchars(trim($_POST['email_reciever']));
if (gcms::isAdmin()) {
$sender = $db->getRec(DB_USER, $_POST['email_from']);
} else {
$sender = $_SESSION['login'];
}
// ตรวจสอบค่าที่ส่งมา
if ($sender['email'] == '') {
$ret['error'] = 'ACTION_ERROR';
} elseif ($reciever == '') {
$ret['error'] = 'RECIEVER_EMPTY';
$ret['input'] = 'email_reciever';
} elseif ($sender == $reciever) {
$ret['error'] = 'ACTION_ERROR';
} elseif ($topic == '') {
$ret['error'] = 'TOPIC_EMPTY';
示例2: header
<?php
// modules/edocument/write_save.php
header("content-type: text/html; charset=UTF-8");
// inint
include '../../bin/inint.php';
$ret = array();
// ตรวจสอบ referer
if (gcms::isReferer() && gcms::isMember()) {
// ค่าที่ส่งมา
$save['document_no'] = $db->sql_trim_str($_POST, 'edocument_no');
$save['topic'] = $db->sql_trim_str($_POST, 'edocument_topic');
$save['detail'] = gcms::ckClean($_POST['edocument_detail']);
if (isset($_POST['edocument_reciever'])) {
$save['reciever'] = implode(',', $_POST['edocument_reciever']);
}
$id = gcms::getVars($_POST, 'write_id', 0);
$file = $_FILES['edocument_file'];
// ตรวจสอบค่าที่ส่งมา
$error = false;
$input = false;
if ($id > 0) {
// แก้ไข
$sql = "SELECT D.*,M.`module`";
$sql .= " FROM `" . DB_EDOCUMENT . "` AS D";
$sql .= " INNER JOIN `" . DB_MODULES . "` AS M ON M.`id`=D.`module_id`";
$sql .= " WHERE D.`id`='{$id}' AND M.`owner`='edocument' LIMIT 1";
} else {
// ใหม่
$sql = "SELECT M.`module`,M.`id` AS `module_id`";
$sql .= ",(SELECT MAX(`id`) FROM `" . DB_EDOCUMENT . "` WHERE `module_id`=M.`id`) AS `id`";