本文整理汇总了PHP中get_request函数的典型用法代码示例。如果您正苦于以下问题:PHP get_request函数的具体用法?PHP get_request怎么用?PHP get_request使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_request函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: get_litecoin
function get_litecoin($address)
{
$return = array();
$data = get_request('http://explorer.litecoin.net/address/' . $address);
if (!empty($data) && strstr($data, 'Transactions in: ') && strstr($data, 'Received: ')) {
$return += array('count' => (int) parse($data, 'Transactions in: ', '<br />'), 'amount' => (double) parse($data, 'Received: ', '<br />'));
return $return;
}
}
示例2: checkPostRequestParams
protected function checkPostRequestParams($arParams)
{
foreach ($arParams['post'] as $strKey => $strValue) {
if (get_request($strKey, 'POST') !== $strValue) {
return false;
}
}
return true;
}
示例3: __construct
public function __construct($title = null, $action = null, $method = null, $enctype = null, $form_variable = null)
{
$method = is_null($method) ? 'post' : $method;
parent::__construct($method, $action, $enctype);
$this->setTitle($title);
$form_variable = is_null($form_variable) ? 'form' : $form_variable;
$this->addVar($form_variable, get_request($form_variable, 1));
$this->bottom_items = new CCol(SPACE, 'form_row_last');
$this->bottom_items->setColSpan(2);
}
示例4: __construct
public function __construct($action = NULL, $method = 'post', $enctype = NULL)
{
parent::__construct('form', 'yes');
$this->setMethod($method);
$this->setAction($action);
$this->setEnctype($enctype);
$this->setAttribute('accept-charset', 'utf-8');
if (isset($_COOKIE['zbx_sessionid'])) {
$this->addVar('sid', substr($_COOKIE['zbx_sessionid'], 16, 16));
}
$this->addVar('form_refresh', get_request('form_refresh', 0) + 1);
}
示例5: get_dogecoin
function get_dogecoin($address)
{
$return = array();
$recieved_data = get_request('https://chain.so/api/v2/get_address_received/DOGE/' . $address);
$tx_data = get_request('https://chain.so/api/v2/get_tx_received/DOGE/' . $address);
if (!empty($recieved_data) && !empty($tx_data)) {
$recieved_data = json_decode($recieved_data);
$tx_data = json_decode($tx_data);
$return += array('count' => (int) count($tx_data->data->txs), 'amount' => (double) $recieved_data->data->confirmed_received_value);
return $return;
}
}
示例6: input
function input($type, $name = '', $placeholder = '')
{
if (strlen($name) == 0) {
$name = $type;
}
if (strlen($placeholder) == 0) {
$placeholder = $name;
}
$value = get_request($name);
$input = "<input type=\"{$type}\" name=\"{$name}\" placeholder=\"{$placeholder}\" value=\"{$value}\"/>";
return $input;
}
示例7: new_global_wiki_variables
/**
* returns new MW_Variables with prefilled global values
*/
function new_global_wiki_variables()
{
$req =& get_request("MW_ActionRequest");
$auth =& get_auth();
$vars = new MW_Variables(null);
$vars->set('wiki_name', config('wiki_name'));
$vars->set('user', $auth->is_logged ? $auth->user : '');
$vars->set('main_page', MW_PAGE_NAME_MAIN);
$action = $req->get_action();
$vars->set('req_action', $action->get_name());
return $vars;
}
示例8: get_request_arg
function get_request_arg($search, $type = 'INT')
{
$arg = NULL;
$query = get_request();
foreach ($query as $key => $value) {
if ($value == $search) {
if (isset($query[$key + 1])) {
$arg = $query[$key + 1];
}
}
}
return $type == 'INT' ? intval($arg) : $arg;
}
示例9: __construct
public function __construct($title = null, $action = null, $method = null, $enctype = null, $form_variable = null)
{
$this->top_items = array();
$this->center_items = array();
$this->bottom_items = array();
$this->tableclass = 'formtable';
if (null == $method) {
$method = 'post';
}
if (null == $form_variable) {
$form_variable = 'form';
}
parent::__construct($action, $method, $enctype);
$this->setTitle($title);
$this->setAlign('center');
$this->setHelp();
$this->addVar($form_variable, get_request($form_variable, 1));
$this->addVar('form_refresh', get_request('form_refresh', 0) + 1);
$this->bottom_items = new CCol(SPACE, 'form_row_last');
$this->bottom_items->setColSpan(2);
}
示例10: login
function login($name, $password, $permanent)
{
$_SESSION['name'] = $name;
$_SESSION['password'] = $password;
error_log($_SESSION['name'] . ' ' . $_SESSION['password']);
$response = get_request(get_serverurl() . '/users/' . $name, true);
if ($response["status"] == 200) {
$response = json_decode($response["response"], true);
$_SESSION['mail'] = $response['mail'];
if ($permanent == true) {
//ToDo: generate a place and remember me cookie
}
return true;
} else {
if (isset($_SESSION)) {
session_destroy();
}
$_SESSION['name'] = null;
$_SESSION['password'] = null;
return false;
}
}
示例11: get_resource
function get_resource($url)
{
$resource = '';
if (!empty($url)) {
$response = get_request($url);
if (!function_exists('str_get_html')) {
require_once dirname(__FILE__) . '/../vendor/simple-html-dom/simple-html-dom.php';
}
if (!function_exists('url_to_absolute')) {
require_once dirname(__FILE__) . '/../vendor/url-to-absolute/url-to-absolute.php';
}
$url_parts = parse_url($url);
//$body = wp_remote_retrieve_body($response);
$body = $response;
$html = str_get_html($body);
foreach ($html->find('a, link') as $element) {
if (isset($element->href) && $element->href[0] != "#") {
$element->href = url_to_absolute($url, $element->href);
}
}
foreach ($html->find('img, script') as $element) {
if (isset($element->src)) {
$element->src = url_to_absolute($url, $element->src);
}
}
foreach ($html->find('form') as $element) {
if (isset($element->action)) {
$element->action = url_to_absolute($url, $element->action);
} else {
$element->action = $url;
}
}
$resource = $html->save();
}
return $resource;
}
示例12: get_request
$_REQUEST['action'] = -1;
$_REQUEST['resourcetype'] = -1;
}
$_REQUEST['alias'] = get_request('alias', CProfile::get('web.auditlogs.filter.alias', ''));
$_REQUEST['action'] = get_request('action', CProfile::get('web.auditlogs.filter.action', -1));
$_REQUEST['resourcetype'] = get_request('resourcetype', CProfile::get('web.auditlogs.filter.resourcetype', -1));
if (isset($_REQUEST['filter_set']) || isset($_REQUEST['filter_rst'])) {
CProfile::update('web.auditlogs.filter.alias', $_REQUEST['alias'], PROFILE_TYPE_STR);
CProfile::update('web.auditlogs.filter.action', $_REQUEST['action'], PROFILE_TYPE_INT);
CProfile::update('web.auditlogs.filter.resourcetype', $_REQUEST['resourcetype'], PROFILE_TYPE_INT);
}
/*
* Display
*/
$effectivePeriod = navigation_bar_calc('web.auditlogs.timeline', 0, true);
$data = array('stime' => get_request('stime'), 'actions' => array(), 'action' => get_request('action'), 'resourcetype' => get_request('resourcetype'), 'alias' => get_request('alias'));
$from = zbxDateToTime($data['stime']);
$till = $from + $effectivePeriod;
// get audit
$sqlWhere = array();
if (!empty($data['alias'])) {
$sqlWhere['alias'] = ' AND u.alias=' . zbx_dbstr($data['alias']);
}
if ($data['action'] > -1) {
$sqlWhere['action'] = ' AND a.action=' . $data['action'] . ' ';
}
if ($data['resourcetype'] > -1) {
$sqlWhere['resourcetype'] = ' AND a.resourcetype=' . $data['resourcetype'] . ' ';
}
$sqlWhere['from'] = ' AND a.clock>' . $from;
$sqlWhere['till'] = ' AND a.clock<' . $till;
示例13: array
include_once "include/page_header.php";
$fields = array("mediatypeid" => array(T_ZBX_INT, O_NO, P_SYS, DB_ID, '(isset({form})&&({form}=="update"))'), "type" => array(T_ZBX_INT, O_OPT, NULL, IN(implode(',', array(MEDIA_TYPE_EMAIL, MEDIA_TYPE_EXEC, MEDIA_TYPE_SMS, MEDIA_TYPE_JABBER))), '(isset({save}))'), "description" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, '(isset({save}))'), "smtp_server" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({type})&&({type}==' . MEDIA_TYPE_EMAIL . ')&&isset({save})'), "smtp_helo" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({type})&&({type}==' . MEDIA_TYPE_EMAIL . ')&&isset({save})'), "smtp_email" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({type})&&({type}==' . MEDIA_TYPE_EMAIL . ')&&isset({save})'), "exec_path" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({type})&&({type}==' . MEDIA_TYPE_EXEC . ')&&isset({save})'), "gsm_modem" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({type})&&({type}==' . MEDIA_TYPE_SMS . ')&&isset({save})'), "username" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, '(isset({type})&&{type}==' . MEDIA_TYPE_JABBER . ')&&isset({save})'), "password" => array(T_ZBX_STR, O_OPT, NULL, NOT_EMPTY, 'isset({type})&&({type}==' . MEDIA_TYPE_JABBER . ')&&isset({save})'), "save" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), "delete" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), "cancel" => array(T_ZBX_STR, O_OPT, P_SYS | P_ACT, NULL, NULL), "form" => array(T_ZBX_STR, O_OPT, P_SYS, NULL, NULL), "form_refresh" => array(T_ZBX_INT, O_OPT, NULL, NULL, NULL));
check_fields($fields);
validate_sort_and_sortorder('mt.description', ZBX_SORT_UP);
/* MEDIATYPE ACTIONS */
$result = 0;
if (isset($_REQUEST["save"])) {
if (isset($_REQUEST["mediatypeid"])) {
/* UPDATE */
/* $action = AUDIT_ACTION_UPDATE;*/
$result = update_mediatype($_REQUEST["mediatypeid"], $_REQUEST["type"], $_REQUEST["description"], get_request("smtp_server"), get_request("smtp_helo"), get_request("smtp_email"), get_request("exec_path"), get_request("gsm_modem"), get_request('username'), get_request('password'));
show_messages($result, S_MEDIA_TYPE_UPDATED, S_MEDIA_TYPE_WAS_NOT_UPDATED);
} else {
/* ADD */
/* $action = AUDIT_ACTION_ADD;*/
$result = add_mediatype($_REQUEST["type"], $_REQUEST["description"], get_request("smtp_server"), get_request("smtp_helo"), get_request("smtp_email"), get_request("exec_path"), get_request("gsm_modem"), get_request('username'), get_request('password'));
show_messages($result, S_ADDED_NEW_MEDIA_TYPE, S_NEW_MEDIA_TYPE_WAS_NOT_ADDED);
}
if ($result) {
/* add_audit($action,AUDIT_RESOURCE_MEDIA_TYPE,
"Media type [".$_REQUEST["description"]."]");
*/
unset($_REQUEST["form"]);
}
} elseif (isset($_REQUEST["delete"]) && isset($_REQUEST["mediatypeid"])) {
/* DELETE */
/* $mediatype=get_mediatype_by_mediatypeid($_REQUEST["mediatypeid"]);*/
$result = delete_mediatype($_REQUEST["mediatypeid"]);
show_messages($result, S_MEDIA_TYPE_DELETED, S_MEDIA_TYPE_WAS_NOT_DELETED);
if ($result) {
/* add_audit(AUDIT_ACTION_DELETE,AUDIT_RESOURCE_MEDIA_TYPE,
示例14: CFormTable
$dashboard_wdgt->setClass('header');
$dashboard_wdgt->addPageHeader(S_DASHBOARD_CONFIGURATION_BIG, SPACE);
//-------------
// GROUPS
$dashForm = new CFormTable(S_FILTER);
$dashForm->addVar('form_refresh', 1);
$dashForm->setName('dashconf');
$dashForm->setAttribute('id', 'dashform');
if (isset($_REQUEST['form_refresh'])) {
$filterEnable = get_request('filterEnable', 0);
$groupids = get_request('groupids', array());
$groupids = zbx_toHash($groupids);
$grpswitch = get_request('grpswitch', 0);
$maintenance = get_request('maintenance', 0);
$extAck = get_request('extAck', 0);
$severity = get_request('trgSeverity', array());
$severity = array_keys($severity);
} else {
$filterEnable = CProfile::get('web.dashconf.filter.enable', 0);
$groupids = get_favorites('web.dashconf.groups.groupids');
$groupids = zbx_objectValues($groupids, 'value');
$groupids = zbx_toHash($groupids);
$grpswitch = CProfile::get('web.dashconf.groups.grpswitch', 0);
$maintenance = CProfile::get('web.dashconf.hosts.maintenance', 1);
$extAck = CProfile::get('web.dashconf.events.extAck', 0);
$severity = CProfile::get('web.dashconf.triggers.severity', '0;1;2;3;4;5');
$severity = zbx_empty($severity) ? array() : explode(';', $severity);
}
$dashForm->addVar('filterEnable', $filterEnable);
if ($filterEnable) {
$cbFilter = new CSpan(S_ENABLED, 'green underline pointer');
示例15: array
**/
require_once "include/config.inc.php";
require_once "include/items.inc.php";
$page["title"] = "S_QUEUE_BIG";
$page["file"] = "queue.php";
$page['hist_arg'] = array('show');
define('ZBX_PAGE_DO_REFRESH', 1);
include_once "include/page_header.php";
// VAR TYPE OPTIONAL FLAGS VALIDATION EXCEPTION
$fields = array("show" => array(T_ZBX_INT, O_OPT, P_SYS, IN("0,1,2"), NULL));
check_fields($fields);
$available_hosts = get_accessible_hosts_by_user($USER_DETAILS, PERM_READ_ONLY, PERM_RES_IDS_ARRAY);
?>
<?php
$_REQUEST["show"] = get_request("show", 0);
$form = new CForm();
$form->SetMethod('get');
$cmbMode = new CComboBox("show", $_REQUEST["show"], "submit();");
$cmbMode->AddItem(0, S_OVERVIEW);
$cmbMode->AddItem(1, S_OVERVIEW_BY_PROXY);
$cmbMode->AddItem(2, S_DETAILS);
$form->AddItem($cmbMode);
show_table_header(S_QUEUE_OF_ITEMS_TO_BE_UPDATED_BIG, $form);
?>
<?php
$now = time();
$item_types = array(ITEM_TYPE_ZABBIX, ITEM_TYPE_ZABBIX_ACTIVE, ITEM_TYPE_SNMPV1, ITEM_TYPE_SNMPV2C, ITEM_TYPE_SNMPV3, ITEM_TYPE_SIMPLE, ITEM_TYPE_INTERNAL, ITEM_TYPE_AGGREGATE, ITEM_TYPE_EXTERNAL);
$result = DBselect('SELECT i.itemid,i.nextcheck,i.description,i.key_,i.type,h.host,h.hostid,h.proxy_hostid ' . ' FROM items i,hosts h ' . ' WHERE i.status=' . ITEM_STATUS_ACTIVE . ' AND i.type in (' . implode(',', $item_types) . ') ' . ' AND ((h.status=' . HOST_STATUS_MONITORED . ' AND h.available != ' . HOST_AVAILABLE_FALSE . ') ' . ' OR (h.status=' . HOST_STATUS_MONITORED . ' AND h.available=' . HOST_AVAILABLE_FALSE . ' AND h.disable_until<=' . $now . ')) ' . ' AND i.hostid=h.hostid ' . ' AND i.nextcheck + 5 <' . $now . ' AND i.key_ NOT IN (' . zbx_dbstr('status') . ',' . zbx_dbstr('icmpping') . ',' . zbx_dbstr('icmppingsec') . ',' . zbx_dbstr('zabbix[log]') . ') ' . ' AND i.value_type not in (' . ITEM_VALUE_TYPE_LOG . ') ' . ' AND ' . DBcondition('h.hostid', $available_hosts) . ' AND ' . DBin_node('h.hostid', get_current_nodeid()) . ' ORDER BY i.nextcheck,h.host,i.description,i.key_');
$table = new CTableInfo(S_THE_QUEUE_IS_EMPTY);