本文整理汇总了PHP中GetVars函数的典型用法代码示例。如果您正苦于以下问题:PHP GetVars函数的具体用法?PHP GetVars怎么用?PHP GetVars使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GetVars函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: SQLLog_getip
function SQLLog_getip()
{
$ip = GetVars('HTTP_CLIENT_IP', 'SERVER');
$ip = $ip == '' ? GetVars('HTTP_X_FORWARDED_FOR', 'SERVER') : $ip;
$ip = $ip == '' ? GetVars('REMOTE_ADDR', 'SERVER') : $ip;
return $ip;
}
示例2: AuditRecords_Main
function AuditRecords_Main($article)
{
global $zbp;
if (isset($_POST['AuditRecords_op'])) {
$ar = new AuditRecords();
$ar->LogID = $article->ID;
$ar->AuthorID = $zbp->user->ID;
$ar->Logs = Trim(GetVars('AuditRecords_logs', 'POST'));
$ar->Opeate = GetVars('AuditRecords_op', 'POST');
if (!$ar->Logs) {
if ($ar->Opeate == -1) {
$ar->Logs = "我有更新了,麻烦请审核一下。";
}
if ($ar->Opeate == 0) {
$ar->Logs = "不想写审核意见,还是不通过。";
}
if ($ar->Opeate == 1) {
$ar->Logs = "通过了通过了,真的没有意见。";
}
}
$ar->PostTime = time();
$ar->Save();
foreach ($GLOBALS['Filter_Plugin_AuditRecords_Submit'] as $fpname => &$fpsignal) {
$fpname($article, $ar->Opeate, $ar->Logs);
}
}
}
示例3: passwordvisit_input_password
function passwordvisit_input_password(&$template)
{
global $zbp;
if (isset($_POST['password']) && $_POST['password'] != '') {
$article = $template->GetTags('article');
if ($article->Metas->passwordvisit_password != '') {
if (GetVars('password', 'POST') == $article->Metas->passwordvisit_password) {
return;
} else {
echo '<script type="text/javascript">alert("密码错误,请重新输入!");window.location="' . $article->Url . '";</script>';
die;
}
} else {
if (GetVars('password', 'POST') == $zbp->Config('passwordvisit')->default_password) {
return;
} else {
echo '<script type="text/javascript">alert("密码错误,请重新输入!");window.location="' . $article->Url . '";</script>';
die;
}
}
} else {
$article = $template->GetTags('article');
if ($zbp->Config('passwordvisit')->all_encrypt || $article->Metas->passwordvisit_enable_encrypt) {
$article->Content = $zbp->Config('passwordvisit')->default_text . '<form id="form1" name="form1" method="post"><input name="password" type="password" width="100px" /><input name="submit" type="submit" value="查看"/></form>';
$template->SetTags('article', $article);
}
}
}
示例4: GetVarsByDefault
/**
* 获取参数值(可设置默认返回值)
* @param string $name 数组key名
* @param string $type 默认为REQUEST
* @param string $default 默认为null
* @return mixed|null
* @since 1.3.140614
*/
function GetVarsByDefault($name, $type = 'REQUEST', $default = null)
{
$g = GetVars($name, $type);
if ($g == null || $g == '') {
return $default;
}
return $g;
}
示例5: AdminColor_Add_Button
function AdminColor_Add_Button(&$leftmenus)
{
global $zbp;
$hm = GetVars('admincolor_hm', 'COOKIE');
if ($hm == '1') {
$leftmenus['nav_admincolor'] = MakeLeftMenu(5, $zbp->lang['AdminColor']['expandmenu'], "javascript:admincolor_showMenu();", "nav_admincolor", "aAdminColor", $zbp->host . "zb_users/plugin/AdminColor/arror2.png");
} else {
$leftmenus['nav_admincolor'] = MakeLeftMenu(5, $zbp->lang['AdminColor']['closemenu'], "javascript:admincolor_hideMenu();", "nav_admincolor", "aAdminColor", $zbp->host . "zb_users/plugin/AdminColor/arror.png");
}
}
示例6: wearingtheme_index_begin
function wearingtheme_index_begin()
{
global $zbp;
global $usersdir;
$app = new App();
$theme = GetVars('theme', 'GET');
if ($theme == '') {
$theme = GetVars('theme', 'COOKIE');
}
$dir = $usersdir . 'theme/' . $theme;
if ($theme == '') {
return;
}
if (!is_dir($dir)) {
return;
}
if (!$app->LoadInfoByXml('theme', $theme)) {
return;
}
$zbp->Config('system')->ZC_BLOG_THEME = $theme;
$zbp->option['ZC_BLOG_THEME'] = $theme;
$zbp->activeapps[0] = $theme;
foreach ($app->GetCssFiles() as $key => $value) {
$value = basename($value, '.css');
$zbp->Config('system')->ZC_BLOG_CSS = $value;
$zbp->option['ZC_BLOG_CSS'] = $value;
break;
}
if (is_readable($filename = $dir . '/include.php')) {
require $filename;
if (isset($GLOBALS['plugins'][$theme])) {
$func_name = $GLOBALS['plugins'][$theme];
if (function_exists($func_name)) {
$func_name();
}
}
}
$zbp->LoadTemplate();
$zbp->MakeTemplatetags();
$zbp->template = $zbp->PrepareTemplate();
setcookie('theme', $theme, time() + 24 * 60 * 60);
/*
TODO:
一、安全问题:
1. 主题任意函数内包含危害服务器安全的代码
2. 主题任意函数内包含危害其它主题的代码(比如new ZipArchive然后POST到新的服务器)
二、主题从APP上传到theme
*/
}
示例7: api_zbp_load_pre
function api_zbp_load_pre()
{
// Check URL first
global $bloghost;
global $apiRealRouteUrl;
global $zbp;
$requestUri = str_replace('index.php?', '', GetVars('HTTP_HOST', 'SERVER') . GetVars('REQUEST_URI', 'SERVER'));
$removedHttpHost = preg_replace('/^http.+\\/\\//', '', $bloghost) . 'zb_system/api/';
$apiRealRouteUrl = str_replace($removedHttpHost, '', $requestUri);
// Now we know that this is API Request, so remove Cookie.
// The verification shoule be in API Route.
//$_COOKIE['username'] = "";
//$_COOKIE['password'] = "";
API::init();
}
示例8: Totoro_Action_Blockip
function Totoro_Action_Blockip()
{
global $zbp;
global $Totoro;
$id = GetVars('id', 'GET');
$id = (int) $id;
if ($id <= 0) {
return;
}
$comment = $zbp->GetCommentByID($id);
if ($comment->ID <= 0) {
return;
}
$Totoro->filter_ip($comment->IP, true);
}
示例9: Totoro_Cmd_Begin
function Totoro_Cmd_Begin()
{
global $zbp;
if (GetVars('act', 'GET') == 'CommentChk') {
if (!$zbp->ValidToken(GetVars('token', 'GET'))) {
$zbp->ShowError(5, __FILE__, __LINE__);
die;
}
$id = (int) GetVars('id', 'GET');
$ischecking = (bool) GetVars('ischecking', 'GET');
if ($ischecking) {
Totoro_init();
global $Totoro;
$Totoro->add_black_list($id);
}
}
}
示例10: api_route_login_function
function api_route_login_function()
{
global $zbp;
$originalString = trim(GetVars('HTTP_AUTHORIZATION', 'SERVER'));
$originalArray = explode(' ', $originalString);
if (strtoupper($originalArray[0]) !== "BASIC" || count($originalArray) !== 2) {
return false;
}
$authString = base64_decode($originalArray[1]);
$authArray = explode(':', $authString);
if (count($authArray) !== 2) {
return false;
}
$key = $authArray[0];
$secret = $authArray[1];
API::$User->login($key, $secret);
}
示例11: GetVars
$mod->HtmlID = GetVars('filename', 'GET');
$mod->Source = 'theme';
if ($mod->FileName) {
$mod->Content = file_get_contents($zbp->usersdir . 'theme/' . $zbp->theme . '/include/' . $mod->FileName . '.php');
}
}
} elseif (isset($_GET['filename'])) {
$array = $zbp->GetModuleList(array('*'), array(array('=', 'mod_FileName', GetVars('filename', 'GET'))), null, array(1), null);
if (count($array) == 0) {
$zbp->ShowError(69);
}
$mod = $array[0];
//'$mod=
} else {
if (isset($_GET['id'])) {
$modid = (int) GetVars('id', 'GET');
} else {
$modid = 0;
}
$mod = $zbp->GetModuleByID($modid);
}
if ($mod->Type == 'ul') {
$mod->Content = str_replace("</li>", "</li>\r\n", $mod->Content);
}
$islock = '';
if ($mod->Source == 'system' || $mod->Source == 'theme') {
$islock = 'readonly="readonly"';
}
if ($mod->Source == 'theme' && $mod->FileName == '') {
$islock = '';
$mod->Name = 'newmodule';
示例12: trim
die;
}
if (!$zbp->CheckPlugin('STACentre')) {
$zbp->ShowError(48);
die;
}
$blogtitle = '静态管理中心';
if (count($_POST) > 0) {
$zbp->option['ZC_STATIC_MODE'] = trim(GetVars('ZC_STATIC_MODE', 'POST'));
$zbp->option['ZC_ARTICLE_REGEX'] = trim(GetVars('ZC_ARTICLE_REGEX', 'POST'));
$zbp->option['ZC_PAGE_REGEX'] = trim(GetVars('ZC_PAGE_REGEX', 'POST'));
$zbp->option['ZC_INDEX_REGEX'] = trim(GetVars('ZC_INDEX_REGEX', 'POST'));
$zbp->option['ZC_CATEGORY_REGEX'] = trim(GetVars('ZC_CATEGORY_REGEX', 'POST'));
$zbp->option['ZC_TAGS_REGEX'] = trim(GetVars('ZC_TAGS_REGEX', 'POST'));
$zbp->option['ZC_DATE_REGEX'] = trim(GetVars('ZC_DATE_REGEX', 'POST'));
$zbp->option['ZC_AUTHOR_REGEX'] = trim(GetVars('ZC_AUTHOR_REGEX', 'POST'));
$zbp->SaveOption();
$zbp->AddBuildModule('archives');
$zbp->AddBuildModule('tags');
$zbp->AddBuildModule('authors');
$zbp->AddBuildModule('previous');
$zbp->AddBuildModule('catalog');
$zbp->AddBuildModule('navbar');
$zbp->BuildModule();
$zbp->SetHint('good');
if ($zbp->option['ZC_STATIC_MODE'] == 'REWRITE' && strpos($zbp->option['ZC_ARTICLE_REGEX'], '{%host%}index.php') === false) {
Redirect('./list.php');
}
Redirect('./main.php');
}
$ua = array('ZC_ARTICLE_REGEX' => array('{%host%}?id={%id%}', '{%host%}index.php/post/{%id%}.html', '{%host%}post/{%id%}.html', '{%host%}post/{%alias%}.html', '{%host%}{%year%}/{%month%}/{%id%}/', '{%host%}{%category%}/{%alias%}'), 'ZC_PAGE_REGEX' => array('{%host%}?id={%id%}', '{%host%}index.php/{%id%}.html', '{%host%}{%id%}.html', '{%host%}{%alias%}.html', '{%host%}{%alias%}/', '{%host%}{%alias%}'), 'ZC_INDEX_REGEX' => array('{%host%}?page={%page%}', '{%host%}index.php/page_{%page%}.html', '{%host%}page_{%page%}.html', '{%host%}page_{%page%}/', '{%host%}page_{%page%}'), 'ZC_CATEGORY_REGEX' => array('{%host%}?cate={%id%}&page={%page%}', '{%host%}index.php/category-{%id%}_{%page%}.html', '{%host%}category-{%id%}_{%page%}.html', '{%host%}category-{%alias%}_{%page%}.html', '{%host%}category/{%alias%}/{%page%}/', '{%host%}category/{%id%}/{%page%}'), 'ZC_TAGS_REGEX' => array('{%host%}?tags={%id%}&page={%page%}', '{%host%}index.php/tags-{%id%}_{%page%}.html', '{%host%}tags-{%id%}_{%page%}.html', '{%host%}tags-{%alias%}_{%page%}.html'), 'ZC_DATE_REGEX' => array('{%host%}?date={%date%}&page={%page%}', '{%host%}index.php/date-{%date%}_{%page%}.html', '{%host%}date-{%date%}_{%page%}.html', '{%host%}post/{%date%}_{%page%}.html'), 'ZC_AUTHOR_REGEX' => array('{%host%}?auth={%id%}&page={%page%}', '{%host%}index.php/author-{%id%}_{%page%}.html', '{%host%}author-{%id%}_{%page%}.html', '{%host%}author/{%id%}/{%page%}/'));
示例13: error_reporting
if(isset($_SESSION['logdebug']) && $_SESSION['logdebug']==1)
{
error_reporting(E_ALL);
}
else
{
error_reporting(E_ERROR);
}
include_once "classes.php";
ini_set('upload_max_filesize',8000000);
if(isset($_REQUEST['act'])) $act = $_REQUEST['act'];
if(isset($_REQUEST['subact'])) $subact = $_REQUEST['subact'];
if(isset($_REQUEST['id'])) $id = (int)$_REQUEST['id']; else $id = 0;
if(isset($_REQUEST['start'])) $start = (int)$_REQUEST['start']; else $start = 0;
if(!isset($act)) $act="none";
if(!isset($subact)) $subact="none";
$varsline = GetVars();
include "modules/workmodules/work_contacts.php";
include "modules/workmodules/work_basket.php";
include "modules/workmodules/work_cabinet.php";
include "modules/workmodules/work_comments.php";
?>
示例14: CheckValidCode
function CheckValidCode($vaidcode, $id = '')
{
foreach ($GLOBALS['Filter_Plugin_Zbp_CheckValidCode'] as $fpname => &$fpsignal) {
return $fpname($vaidcode, $id);
//*
}
$original = GetVars('zbpvalidcode' . md5($this->guid . $id), 'COOKIE');
if (md5($this->guid . date("Ymd") . $vaidcode) == $original) {
return true;
}
}
示例15: dirname
<?php
require '../../../zb_system/function/c_system_base.php';
require '../../../zb_system/function/c_system_admin.php';
require dirname(__FILE__) . '/function.php';
$zbp->Load();
$action = 'root';
if (!$zbp->CheckRights($action)) {
$zbp->ShowError(6);
die;
}
if (!$zbp->CheckPlugin('AppCentre')) {
$zbp->ShowError(48);
die;
}
if (!$zbp->ValidToken(GetVars('token', 'GET'))) {
$zbp->ShowError(5, __FILE__, __LINE__);
die;
}
foreach ($_FILES as $key => $value) {
if ($_FILES[$key]['error'] == 0) {
if (is_uploaded_file($_FILES[$key]['tmp_name'])) {
$tmp_name = $_FILES[$key]['tmp_name'];
$name = $_FILES[$key]['name'];
$xml = file_get_contents($tmp_name);
if (App::UnPack($xml)) {
$zbp->SetHint('good', '上传APP并解压成功!');
Redirect($_SERVER["HTTP_REFERER"]);
} else {
$zbp->SetHint('bad', $zbp->lang['error']['64']);
Redirect($_SERVER["HTTP_REFERER"]);