当前位置: 首页>>代码示例>>PHP>>正文


PHP Utility::HttpRequest方法代码示例

本文整理汇总了PHP中Utility::HttpRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP Utility::HttpRequest方法的具体用法?PHP Utility::HttpRequest怎么用?PHP Utility::HttpRequest使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Utility的用法示例。


在下文中一共展示了Utility::HttpRequest方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: get_base_info

 public function get_base_info()
 {
     $query_data = array('api_id' => $this->appid, 'api_secret' => $this->appsecret);
     $sendurl = $this->api_url . http_build_query($query_data);
     $result = Utility::HttpRequest($sendurl);
     die(dump($result));
 }
开发者ID:caijinlin,项目名称:hackathon,代码行数:7,代码来源:SenseTimeAction.class.php

示例2: ip_location_youdao

function ip_location_youdao($ip)
{
    $u = "http://www.youdao.com/smartresult-xml/search.s?type=ip&q={$ip}";
    $r = mb_convert_encoding(Utility::HttpRequest($u), 'UTF-8', 'GBK');
    preg_match("#<location>(.+)</location>#Ui", $r, $m);
    return strval($m[1]);
}
开发者ID:norain2050,项目名称:zuituware,代码行数:7,代码来源:utility.php

示例3: sms_send

function sms_send($phone, $content)
{
    global $INI;
    if (mb_strlen($content, 'UTF-8') < 20) {
        return '短信长度低于20汉字?长点吧~';
    }
    /* include customsms function */
    $smsowner_file = dirname(__FILE__) . '/smsowner.php';
    if (file_exists($smsowner_file)) {
        require_once $smsowner_file;
        if (function_exists('sms_send_owner')) {
            return sms_send_owner($phone, $content);
        }
    }
    /* end include */
    $user = strval($INI['sms']['user']);
    $pass = strtolower(md5($INI['sms']['pass']));
    if (null == $user) {
        return true;
    }
    $content = urlEncode($content);
    $api = "http://notice.zuitu.com/sms?user={$user}&pass={$pass}&phones={$phone}&content={$content}";
    $res = Utility::HttpRequest($api);
    return trim(strval($res)) == '+OK' ? true : strval($res);
}
开发者ID:norain2050,项目名称:zuituware,代码行数:25,代码来源:sms.php

示例4: zuitu_action

function zuitu_action($action, $version = 'V1.0')
{
    global $INI;
    $user = $INI['sms']['user'];
    $host = strtolower(strval($_SERVER['HTTP_HOST']));
    $url = "http://notice.zuitu.com/version.php?action={$action}&version={$version}&user={$user}&host={$host}";
    $r = Utility::HttpRequest($url);
    return json_decode($r, true);
}
开发者ID:BGCX262,项目名称:zuitu-svn-to-git,代码行数:9,代码来源:upgrade.php

示例5: config_url_add

 public function config_url_add($data)
 {
     include_once TOA_ROOT . 'include/class_Utility.php';
     $httpurl = $this->confgi_url() . '/office/' . $this->config_oaurl($data) . '?uid=' . $this->config_data('com_userid') . '&number=' . $this->config_data('com_number');
     $re_user = Utility::HttpRequest($httpurl);
     $content = array();
     $content['version'] = array('copyright' => $re_user);
     write_to_file('version', $content);
     return $re_user;
 }
开发者ID:haogm123,项目名称:ydoa,代码行数:10,代码来源:class_config.php

示例6: sms_send

function sms_send($phone, $content)
{
    global $INI;
    if (mb_strlen($content, 'UTF-8') < 20) {
        return '短信长度低于20汉字?长点吧~';
    }
    $user = $INI['sms']['user'];
    $pass = strtolower(md5($INI['sms']['pass']));
    $content = urlEncode($content);
    $api = "http://notice.zuitu.com/sms?user={$user}&pass={$pass}&phones={$phone}&content={$content}";
    $res = Utility::HttpRequest($api);
    return trim(strval($res)) == '+OK' ? true : strval($res);
}
开发者ID:BGCX262,项目名称:zuitu-svn-to-git,代码行数:13,代码来源:sms.php

示例7: get_city

function get_city($ip = null)
{
    $cities = option_category('city', false, true);
    $ip = $ip ? $ip : Utility::GetRemoteIP();
    $url = "http://open.baidu.com/ipsearch/s?wd={$ip}&tn=baiduip";
    $res = mb_convert_encoding(Utility::HttpRequest($url), 'UTF-8', 'GBK');
    if (preg_match('#来自:<b>(.+)</b>#Ui', $res, $m)) {
        foreach ($cities as $one) {
            if (FALSE !== strpos($m[1], $one['name'])) {
                return $one;
            }
        }
    }
    return array();
}
开发者ID:hhdem,项目名称:tuangala_v2,代码行数:15,代码来源:utility.php

示例8: remote_action

function remote_action($action, $version = 'V1.0', $condition = array ()) {
	global $INI;

//	$api = "ustore.tuanzbao.com";				//服务器地址
//	$api = "127.0.0.1:8080"; //服务器地址
	$api = USTORE_REMOTE_HOST;
	$host = strtolower(strval($_SERVER['HTTP_HOST']));
	$user = $INI['sms']['smsbao_user']; //平台帐号
	$pass = md5($INI['sms']['smsbao_pass']); //短信平台密码
	
	$url = "{$api}/rest/{$action}?version={$version}&user={$user}&password={$pass}&host=" . urlencode($host) . buildCondition($condition);
//	die($url);
	$r = Utility :: HttpRequest($url);
//	die($r);
	return json_decode($r, true);
}
开发者ID:noikiy,项目名称:mdwp,代码行数:16,代码来源:remote.php

示例9: PHONE_ADD_POST

function PHONE_ADD_POST($person = 0, $content = 0, $receiveperson = 0, $type = 0, $url = 0, $userid = 0)
{
    //判断当前可用通道
    global $db;
    $blog = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "phone_channel where id=1 and pkey='1' and (type='2' or type='3') order by id desc");
    //获取账户信息
    $username = $blog["username"];
    $password = $blog["password"];
    //获取接口信息
    $connection = explode('#515158#', $blog["connection"]);
    $personfor = explode(',', $person);
    $receivepersonfor = explode(',', $receiveperson);
    //$ef='';
    for ($i = 0; $i < sizeof($personfor); $i++) {
        if ($personfor[$i] != '') {
            $date = get_date('y-m-d H:i:s', PHP_TIME);
            $sms_add = explode('#01', $connection[2]);
            $ugcode_vod = new ugcode();
            $contentgdb2312 = $ugcode_vod->ugcode_vod(1, $content);
            $phoneurl = $sms_add[0] . trim($username) . $sms_add[1] . trim($password) . $sms_add[2] . trim($personfor[$i]) . $sms_add[3] . trim($contentgdb2312) . $sms_add[4] . $sms_add[5];
            $res = Utility::HttpRequest($phoneurl);
            if ($blog["connectionid"] == '1') {
                $res_sms = explode('/', $res);
                if ($res_sms[0] == '000') {
                    $type = '1';
                } else {
                    $type = '2';
                }
            } else {
                $res_sms = explode('&', $res);
                if ($res_sms[0] == 'result=0') {
                    $type = '1';
                } else {
                    $type = '2';
                }
            }
            //数据入库
            $phone_send = array('content' => $content, 'receivephone' => $personfor[$i], 'sendperson' => $userid, 'receiveperson' => $receivepersonfor[$i], 'date' => get_date('y-m-d H:i:s', PHP_TIME), 'type' => $type, 'channelid' => $blog["id"]);
            insert_db('phone_send', $phone_send);
            sleep(1);
        }
    }
}
开发者ID:haogm123,项目名称:ydoa,代码行数:43,代码来源:sms.class.php

示例10: check_balans_rest

function check_balans_rest()
{
    $settings = get_settings();
    if ($settings['sms_api_username'] == '' || $settings['sms_api_password'] == '') {
        //echo '<p>Не указаны параметры для отправки СМС !</p>';
        return false;
    }
    $rest_credits = Utility::HttpRequest('http://api.iqsms.ru/messages/v2/balance/', array('login' => $settings['sms_api_username'], 'password' => $settings['sms_api_password']));
    if ($rest_credits) {
        $rest_credits_ar = explode(';', $rest_credits);
        if ($rest_credits_ar[0] == 'RUB' && isset($rest_credits_ar[1])) {
            return (int) $rest_credits_ar[1];
        } else {
            return false;
        }
    } else {
        return false;
    }
}
开发者ID:serker72,项目名称:master-72,代码行数:19,代码来源:iqsms_function.php

示例11: get_city

function get_city($ip = null)
{
    global $INI;
    $hotcity_keys = array_keys($INI['hotcity']);
    $cities = DB::LimitQuery('category', array('condition' => array('zone' => 'city'), 'cache' => 2592000));
    $ip = $ip ? $ip : Utility::GetRemoteIP();
    $url = "http://open.baidu.com/ipsearch/s?wd={$ip}&tn=baiduip";
    $res = mb_convert_encoding(Utility::HttpRequest($url), 'UTF-8', 'GBK');
    $city = array();
    if (preg_match('#来自:<b>(.+)</b>#Ui', $res, $m)) {
        foreach ($cities as $one) {
            if (FALSE !== strpos($m[1], $one['name'])) {
                $city = $one;
                break;
            }
        }
    }
    if (!in_array($city['ename'], $hotcity_keys)) {
        return DB::LimitQuery('category', array('condition' => array('zone' => 'city', 'ename' => $hotcity_keys[0]), 'one' => true));
    }
    return $city;
}
开发者ID:jowino,项目名称:bd786110cact,代码行数:22,代码来源:utility.php

示例12: elseif

if ($do == 'list') {
    include_once 'template/version.php';
} elseif ($do == 'save') {
    for ($i = 1; $i <= 16; $i++) {
        if ($i % 4 == 0 && $i < 16) {
            $strs = '-';
        } else {
            $strs = '';
        }
        $namearr .= getGP('t' . $i . '', 'P') . $strs;
    }
    if (getGP('com_number', 'P') != '') {
        $namearr = getGP('com_number', 'P');
    }
    $httpurl = $_CONFIG->confgi_url() . '/office/' . $_CONFIG->config_oaurl('version') . '?nums=' . $_POST["nums"] . '&number=' . strtoupper(trim($namearr));
    $re_user = Utility::HttpRequest($httpurl . '&date=' . get_date('YmdHis', PHP_TIME));
    $re_user = explode('|', $re_user);
    //数据处理
    if ($re_user[0] != '1') {
        //com_name
        if ($_CONFIG->config_data_name('com_name') != '') {
            get_config_update('com_name', $re_user[0]);
        } else {
            get_config_insert('com_name', $re_user[0]);
        }
        //com_person
        if ($_CONFIG->config_data_name('com_person') != '') {
            get_config_update('com_person', $re_user[1]);
        } else {
            get_config_insert('com_person', $re_user[1]);
        }
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_version.php

示例13: sms_send_smsbao

function sms_send_smsbao($phone, $content) {
	global $INI;
	
	if (empty($content)) {
		return '短信内容为空?写点吧~';
	}





	$content = Utility::Content($content);

	//配置信息
	$smsapi = "api.smsbao.com";					//短信网关
	$charset = "utf8";							//文件编码
	$user = $INI['sms']['smsbao_user']; 		//短信平台帐号
	$pass = md5($INI['sms']['smsbao_pass']);			//短信平台密码
	$wwwprefix = $INI['system']['wwwprefix'];
	
	$statusStr = array(
		"0" => "短信发送成功",
		"-1" => "参数不全",
		"-2" => "服务器空间不支持,请确认支持curl或者fsocket,联系您的空间商解决或者更换空间!",
		"30" => "密码错误",
		"40" => "账号不存在",
		"41" => "余额不足",
		"42" => "帐户已过期",
		"43" => "IP地址限制",
		"50" => "内容含有敏感词"
	);

	if (function_exists('curl_exec') == 1)
	{
		//发送地址
		$sendurl = "http://{$smsapi}/sms?u={$user}&p={$pass}&m={$phone}&c=".urlencode($content)."&r=".urlencode($wwwprefix."/api/smsbao.php?type=feedback");
		$result = Utility::HttpRequest($sendurl);
	}else{
		include_once("snoopy.php");
		$snoopy = new snoopy();
		$sendurl = "http://{$smsapi}/sms?u={$user}&p={$pass}&m={$phone}&c=".urlencode($content)."&r=".urlencode($wwwprefix."/api/smsbao.php?type=feedback");
		$snoopy->fetch($sendurl);
		$result = $snoopy->results;
	}
	
	if (trim(strval($result))=='') $result='-2';
	$code = intval(trim($result));
	if($code == 0){
		return true;
	}else{
		return $statusStr[$code];
  }
}
开发者ID:noikiy,项目名称:mdwp,代码行数:53,代码来源:sms.php

示例14: exit

(!defined('IN_TOA') || !defined('IN_ADMIN')) && exit('Access Denied!');
if (!is_superadmin()) {
    prompt('对不起,你没有权限执行本操作!');
}
get_key("office_sms_read");
empty($do) && ($do = 'list');
if ($do == 'list') {
    global $db;
    $blog = $db->fetch_one_array("SELECT * FROM " . DB_TABLEPRE . "phone_channel where id=1 and pkey='1' and (type='2' or type='3')   order by id desc");
    //获取账户信息
    $username = $blog["username"];
    $password = $blog["password"];
    $connection = explode('#515158#', $blog["connection"]);
    $sms_add = explode('#01', $connection[3]);
    $phoneurl = $sms_add[0] . trim($username) . $sms_add[1] . trim($password);
    $res = Utility::HttpRequest($phoneurl);
    $rqnum = explode('||', $res);
    for ($i = 0; $i < sizeof($rqnum); $i++) {
        $revalue = explode('#', $rqnum[$i]);
        if ($rqnum[$i] != '') {
            $phone_receive = array('content' => u8gb($revalue[1]), 'sendphone' => $revalue[0], 'date' => $revalue[2]);
            //接收消息表
            insert_db('phone_receive', $phone_receive);
        }
    }
    //////////////////////////////////////////////
    //读数据
    //列表信息
    $wheresql = '';
    $page = max(1, getGP('page', 'G', 'int'));
    $pagesize = 20;
开发者ID:haogm123,项目名称:ydoa,代码行数:31,代码来源:mod_smsreceive.php

示例15: date_default_timezone_get

if (date_default_timezone_get()) {
    echo 'date_default_timezone_set: ' . date_default_timezone_get() . '<br />';
}
if (ini_get('date.timezone')) {
    echo 'date.timezone: ' . ini_get('date.timezone') . '<br />';
}
$now = date("Y-m-d H:i:s");
echo "<p>дата - {$now}</p>";
$dateTime = new DateTime("now", new DateTimeZone('GMT'));
$mysqldate = $dateTime->format("Y-m-d H:i:s");
echo "<p>дата для mysql - {$mysqldate}</p>";
echo '<p>узнаем текущий баланс JSON</p>';
var_dump($gate->credits());
// узнаем текущий баланс
echo '<p>узнаем текущий баланс REST</p>';
$rest_credits = Utility::HttpRequest('http://api.iqsms.ru/messages/v2/balance/', array('login' => 'z1469184353311', 'password' => '948621'));
$rest_credits = explode(';', $rest_credits);
var_dump($rest_credits);
echo '<p>получаем список доступных подписей</p>';
var_dump($gate->senders());
// получаем список доступных подписей
$messages = array(array("clientId" => "1", "phone" => "79222605250", "text" => "Тестовое сообщение"));
//var_dump($gate->send($messages, 'testQueue')); // отправляем пакет sms
/*$messages = array(
    array("clientId"=>"1","smscId"=>1885654369),
//    array("clientId"=>"2","smscId"=>11255143),
//    array("clientId"=>"3","smscId"=>11255144),
);*/
echo '<p>получаем статусы для пакета sms</p>';
var_dump($gate->status($messages));
// получаем статусы для пакета sms
开发者ID:serker72,项目名称:master-72,代码行数:31,代码来源:test_iqsms.php


注:本文中的Utility::HttpRequest方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。