本文整理汇总了PHP中check函数的典型用法代码示例。如果您正苦于以下问题:PHP check函数的具体用法?PHP check怎么用?PHP check使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了check函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: crnos
function crnos($class1)
{
if (!check('CR')) {
echo "Error : Page allowed only to CRs";
} else {
include 'config/db.php';
include 'config/settings.php';
include 'config/globals.php';
$branch = $globalbranch;
$table = $branchyear . '_Students';
$userid = $_SESSION['UserId'];
$q = "select Branch,Class,Position from {$table} where Id = '{$userid}'";
$res = mysql_query($q) or die(mysql_error());
$row = mysql_fetch_array($res);
$branch = $row['Branch'];
$class = $row['Class'];
if ($class1 != $class) {
echo "Error: Not authorised to access {$branch}{$class1} details.";
} else {
$cnt = 1;
$table = $branch . $class . '_Cache';
$q = mysql_query("select `Id`,`RNo` from {$table}");
$class_total = mysql_num_rows($q);
while ($row = mysql_fetch_array($q)) {
echo $row['RNo'];
if ($cnt != $class_total) {
echo ",";
}
$cnt++;
}
}
}
}
示例2: edit
/**
* You can edit an existing Comic using this function. The first argument
* must be the id of the row to be edited
*/
function edit($id, $name, $feed, $url, $description = false, $type = false, $fetch_regexp = false, $title_match_regexp = false, $update_frequency = false)
{
if (!$id) {
return -1;
}
$validation_errors = check($this->getValidationRules(), 2);
if ($validation_errors) {
$GLOBALS['QUERY']['error'] = "Please correct the errors before continuing...<br />" . $validation_errors;
return false;
}
$this->newRow($id);
$this->field['name'] = $name;
$this->field['feed'] = $feed;
$this->field['url'] = $url;
if ($description !== false) {
$this->field['description'] = $description;
}
if ($type !== false) {
$this->field['type'] = $type;
}
if ($fetch_regexp !== false) {
$this->field['fetch_regexp'] = $fetch_regexp;
}
if ($title_match_regexp !== false) {
$this->field['title_match_regexp'] = $title_match_regexp;
}
if ($update_frequency !== false) {
$this->field['update_frequency'] = $update_frequency;
}
return $this->save();
}
示例3: post
function post()
{
global $_G;
if ($_GET['onsubmit'] && check()) {
$arr = array();
$arr['title'] = trim_html($_GET['title'], 1);
$arr['fid'] = intval($_GET['fid']);
$value = $_GET['postdb'];
$arr['value'] = serialize($value);
$url = '';
if ($_GET['id']) {
$id = intval($_GET['id']);
DB::update(__CLASS__, $arr, "id=" . $id);
$url = '&id=' . $id;
$msg = '修改';
} else {
$msg = '添加';
$arr['dateline'] = TIMESTAMP;
$arr['count'] = 0;
$arr['updatetime'] = 0;
$arr['count'] = 0;
DB::insert(__CLASS__, $arr, true);
}
cpmsg($msg . '成功', 'success', 'm=' . __CLASS__ . '&a=' . __FUNCTION__ . $url);
} elseif ($_GET['id']) {
$id = intval($_GET['id']);
$rs = DB::fetch_first("SELECT * FROM " . DB::table('fetch') . " WHERE id = " . $id);
$fetch = dunserialize($rs['value']);
$fetch = array_merge($fetch, $rs);
//dump($fetch);
}
$cates = (include libfile('config/taobao_cate'));
$this->add(array('cates' => $cates, 'fetch' => $fetch));
$this->show();
}
示例4: process
public function process(Vtiger_Request $request)
{
$db = PearDatabase::getInstance();
if ($request->get('file') == 'ShowModuleIdField') {
$html = ShowModuleIdField($request->get('selected_module'));
$response = new Vtiger_Response();
$response->setResult($html);
$response->emit();
} elseif ($request->get('file') == 'CheckForTemplates') {
include "modules/OSSPdf/CheckForTemplates_function.php";
$value = check();
$response = new Vtiger_Response();
$response->setResult($value);
$response->emit();
} elseif ($request->get('file') == 'PDFExport') {
include "modules/OSSPdf/PDFExport.php";
} else {
if ($request->get('mode') == 'Popup') {
$html = Popup($request);
$response = new Vtiger_Response();
$response->setResult($html);
$response->emit();
}
}
}
示例5: edit
/**
* You can edit an existing Task using this function. The first argument
* must be the id of the row to be edited
*/
function edit($id, $name, $description = false, $status = false, $type = false, $completed_on = false, $project_id = false)
{
if (!$id) {
return -1;
}
$validation_errors = check($this->getValidationRules(), 2);
if ($validation_errors) {
$GLOBALS['QUERY']['error'] = "Please correct the errors before continuing...<br />" . $validation_errors;
return false;
}
$this->newRow($id);
$this->field['name'] = $name;
if ($description !== false) {
$this->field['description'] = $description;
}
if ($completed_on !== false) {
$this->field['completed_on'] = $completed_on;
}
if ($status !== false) {
$this->field['status'] = $status;
}
if ($type !== false) {
$this->field['type'] = $type;
}
if ($project_id !== false) {
$this->field['project_id'] = $project_id;
}
return $this->save();
}
示例6: acl
/**
* Returns true if the current user has an acl compatible with $check.
* Arguments of static methods of Granted can be passed as extra args.
*
* @param string $check
* @return boolean
*/
function acl($check)
{
global $current_user_acl;
$acl = $current_user_acl;
if ($acl['p']['ForbiddenAccess']) {
return false;
}
if ($acl['p']['System']) {
return true;
}
$result = false;
$match = substr($check, 0, 2);
switch ($match) {
case 'u:':
case 'g:':
case 'p:':
$type = substr($check, 0, 1);
$target = substr($check, 2);
$result = check($acl[$type], $target);
break;
default:
$args = array_slice(func_get_args(), 1);
if (is_callable(array('Granted', $check))) {
$result = call_user_func_array(array('Granted', $check), $args);
}
}
return $result;
}
示例7: check
function check($dir)
{
$dh = opendir($dir);
while (false !== ($file = readdir($dh))) {
if ($file == '.' || $file == '..') {
continue;
}
if (is_dir($dir . '/' . $file)) {
check($dir . '/' . $file);
} elseif (preg_match('@\\.php$@', $file)) {
$p = file_get_contents($dir . '/' . $file);
if (preg_match('@^(.+)<\\?php@iU', $p, $m)) {
echo $dir . '/' . $file . ' has padding space' . "\n";
} elseif (preg_match('@\\?>(.+)$@iU', $p, $m)) {
if ($m[1] === "\n" || ord($m[1][0]) === 13 && ord($m[1][1]) === 0) {
continue;
}
for ($i = 0; $i <= strlen($m[1]); $i++) {
$char = $m[1][$i];
echo $i . "/" . ord($char) . ": " . dechex(ord($char)) . "\n";
}
echo $dir . '/' . $file . ' has trailing space' . "\n";
print_r($m);
}
}
}
}
示例8: __construct
function __construct()
{
parent::__construct();
// Set base crumb
$this->bep_site->set_crumb($this->lang->line('backendpro_control_panel'),'admin');
// Set container variable
$this->_container = $this->config->item('backendpro_template_admin') . "container.php";
$this->_phpinfocontainer = $this->config->item('backendpro_template_admin') . "phpinfocontainer.php";
// Set Pop container variable
$this->_popup_container = $this->config->item('backendpro_template_admin') . "popup.php";
// Make sure user is logged in
check('Control Panel');
// Check to see if the install path still exists
if( is_dir('install'))
{
flashMsg('warning',$this->lang->line('backendpro_remove_install'));
}
// Set private meta tags
//$this->bep_site->set_metatag('name','content',TRUE/FALSE);
$this->bep_site->set_metatag('robots','nofollow, noindex');
$this->bep_site->set_metatag('pragma','nocache',TRUE);
// Load the ADMIN asset group
$this->bep_assets->load_asset_group('ADMIN');
// Loading module model for menu on the left
$this->load->model('category/MCats');
$this->load->model('currency/MCurrency');
$this->lang->load('shop');
$this->load->language('kaimonokago/kaimonokagoadmin');
$this->load->language('welcome/webshop');
log_message('debug','BackendPro : Admin_Controller class loaded');
}
示例9: on_action
function on_action()
{
global $wpdb;
function check($post)
{
$post = preg_replace("/\\,/sm", "", $post);
$post = preg_replace("/<>/sm", "", $post);
return $post;
}
if ($_POST['action'] == 'edit') {
for ($i = 0; $i < count($_POST['set01']); $i++) {
$set01 = $_POST['set01'][$i];
$set02 = check($_POST['chage1_1'][$i]) . ',' . check($_POST['chage1_2'][$i]) . '<>';
$set02 .= check($_POST['chage2_1'][$i]) . ',' . check($_POST['chage2_2'][$i]) . '<>';
$set02 .= check($_POST['chage3_1'][$i]) . ',' . check($_POST['chage3_2'][$i]) . '<>';
$set02 .= check($_POST['chage4_1'][$i]) . ',' . check($_POST['chage4_2'][$i]);
$set03 = $_POST['set03'][$i];
$setid = $_POST['in_id'][$i];
$query = "update CART_cartedit set set01='{$set01}',set02='{$set02}',set03='{$set03}' where id={$setid}";
$wpdb->query($query);
}
$this->message = '<div id="message" class="updated below-h2">
<p>' . __('Settlement Method Setup data updated', 'WP-OliveCart') . '</p>
</div>';
}
$mylink = $wpdb->get_results('SELECT * FROM CART_cartedit');
$this->title = __('Settlement Method Setup', 'WP-OliveCart');
$this->action = 'edit';
$this->icon = 'cart';
return $mylink;
}
示例10: sql_runquery
function sql_runquery()
{
global $_G;
if ($_GET['onsubmit'] && check() && $_GET['query_string']) {
$query_string = trim($_GET['query_string']);
if (strstr($query_string, ';')) {
$query_string = explode(';', $query_string);
}
$query_string = (array) $query_string;
$update = true;
$msg = '';
$query_string = array_filter($query_string);
$query_string = array_unique($query_string);
$i = 0;
foreach ($query_string as $k => $v) {
if ($v) {
$cmd = trim(strtoupper(substr($v, 0, strpos($v, ' '))));
if ($cmd === 'UPDATE' || $cmd === 'DELETE') {
$update = false;
}
DB::query($v, array(), $update);
$msg .= '<p>' . $v . ',影响行数:' . DB::affected_rows() . '</p>';
$i++;
}
}
cpmsg('成功执行:' . $i . '条SQL语句' . $msg, 'success', 'm=' . __CLASS__ . '&a=' . __FUNCTION__, '', "<p claaa='red'>如果更改了某些系统数据,请手动更新系统缓存</p>");
return false;
}
$this->show();
}
示例11: Admin_Controller
function Admin_Controller()
{
parent::Site_Controller();
// Set base crumb
$this->bep_site->set_crumb($this->lang->line('backendpro_control_panel'), 'admin');
// Set container variable
$this->_container = $this->config->item('backendpro_template_admin') . "container.php";
// Set Pop container variable
$this->_popup_container = $this->config->item('backendpro_template_admin') . "popup.php";
// Make sure user is logged in
check('Control Panel');
// Check to see if the install path still exists
if (is_dir('install')) {
flashMsg('warning', $this->lang->line('backendpro_remove_install'));
}
// Set private meta tags
//$this->bep_site->set_metatag('name','content',TRUE/FALSE);
$this->bep_site->set_metatag('robots', 'nofollow, noindex');
$this->bep_site->set_metatag('pragma', 'nocache', TRUE);
// Load the ADMIN asset group
$this->bep_assets->load_asset_group('ADMIN');
// Loading language file here rather than Shop_admin_controller.php.
// Otherwise menu items will not be displayed
$this->lang->load('shop');
$this->load->module_language('kaimonokago', 'kaimonokagoadmin');
$this->load->module_language('welcome', 'webshop');
log_message('debug', 'BackendPro : Admin_Controller class loaded');
}
示例12: go
function go($board, $colour, $cpu)
{
$col = 0;
showBoard($board);
$cols = cols($board);
if ($cpu == 0) {
while (!in_array($col, $cols)) {
$msg = 'player ' . $colour . ' - please choose a column (' . implode(',', $cols) . '): ';
$col = readline($msg);
}
} else {
sleep(0.5);
print 'cpu thinking... ' . "\n";
$col = $cols[array_rand($cols, 1)];
}
sleep(1);
array_push($board[$col], $colour);
if (check($board, $col)) {
win($board, $colour);
sleep(1);
return 1;
} else {
return $board;
}
}
示例13: image
function image($path, $width = '', $height = '')
{
if (check($path)) {
return href('/public/scripts/timthumb.php?src=' . href($path) . '&w=' . $width . '&h=' . $height);
} else {
display_error('The image ' . href($path) . ' was not found');
}
}
示例14: __construct
function __construct()
{
parent::__construct();
check('Control Panel');
// Load the ADMIN asset group
$this->bep_assets->load_asset_group('ADMIN');
}
示例15: verify
public function verify($username, $password)
{
$user = User::where('email', $username)->first();
if ($user && check($password, $user->password)) {
return $user;
}
return null;
}