當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Http::execute方法代碼示例

本文整理匯總了PHP中Http::execute方法的典型用法代碼示例。如果您正苦於以下問題:PHP Http::execute方法的具體用法?PHP Http::execute怎麽用?PHP Http::execute使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Http的用法示例。


在下文中一共展示了Http::execute方法的10個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: isNewBrowscapVersion

function isNewBrowscapVersion()
{
    if (!isset($_SESSION['user_browscap_version'])) {
        $_SESSION['user_browscap_version'] = getCurrentBrowscapRelease();
    }
    if (!isset($_SESSION['server_browscap_version'])) {
        $server_browscap_version = "";
        if (extension_loaded('soap')) {
            $http = new Http();
            $http->setTimeout(2);
            $http->execute("http://www.website-php.com/en/webservices/wsp-information-server.wsdl?wsdl");
            $wsdl = $http->getResult();
            if ($wsdl != "" && find($wsdl, "<?xml", 1) > 0) {
                $client = new WebSitePhpSoapClient("http://www.website-php.com/en/webservices/wsp-information-server.wsdl?wsdl");
                $server_browscap_version = $client->getBrowscapVersionNumber();
            }
        } else {
            /*$http = new Http();
            		$http->setTimeout(2);
            		$http->execute("http://browsers.garykeith.com/versions/version-number.asp");
            		$server_browscap_version = $http->getResult();*/
            $server_browscap_version = "";
        }
        if (trim($server_browscap_version) != "") {
            $_SESSION['server_browscap_version'] = $server_browscap_version;
        }
    }
    if (trim($_SESSION['user_browscap_version']) != trim($_SESSION['server_browscap_version'])) {
        return trim($_SESSION['server_browscap_version']);
    }
    return false;
}
開發者ID:kxopa,項目名稱:WebSite-PHP,代碼行數:32,代碼來源:utils-version.inc.php

示例2: request

 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     error_reporting(0);
     /*Catch XML Exceptions*/
     global $zone_detail;
     $httpConfig['method'] = 'GET';
     $httpConfig['timeout'] = '1';
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner') {
         $request_url = 'http://m2m1.inner-active.mobi/simpleM2M/clientRequestEnhancedHtmlAd';
         $http->addParam('aid', $network_ids['p_1']);
         $http->addParam('v', 'Sm2m-1.5.3');
         if ($request_info['main_device'] == 'IPHONE' or $request_info['main_device'] == 'IPOD TOUCH') {
             $http->addParam('po', '642');
         } else {
             if ($request_info['main_device'] == 'IPAD') {
                 $http->addParam('po', '947');
             } else {
                 if ($request_info['main_device'] == 'ANDROID') {
                     $http->addParam('po', '559');
                 } else {
                     $http->addParam('po', '551');
                 }
             }
         }
         $http->addParam('ua', $request_info['user_agent']);
         $http->addParam('cip', $request_info['ip_address']);
         if (isset($_GET['o'])) {
             $http->addParam('hid', md5($_GET['o']));
         }
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     if ($http->result == '' or !preg_match('<input type="hidden" id="inneractive-error" value="OK" />', $http->result)) {
         return false;
     }
     $ad = array();
     $ad['main_type'] = 'display';
     $ad['type'] = 'markup';
     $ad['click_url'] = '';
     $ad['html_markup'] = $ad['markup'];
     $ad['trackingpixel'] = '';
     $ad['image_url'] = '';
     $ad['clicktype'] = 'safari';
     $ad['skipoverlay'] = 1;
     $ad['skippreflight'] = 'yes';
     return $ad;
     //old below
     /*F:END*/
 }
開發者ID:aiurlano,項目名稱:mAdserve-Fork,代碼行數:56,代碼來源:request.php

示例3: request

 public function request($request_type, $request_info, $network_ids, $backfill)
 {
     /*F:START*/
     error_reporting(0);
     /*Catch XML Exceptions*/
     global $zone_detail;
     $httpConfig['method'] = 'POST';
     $httpConfig['timeout'] = '1';
     $http = new Http();
     $http->initialize($httpConfig);
     if ($request_type == 'banner') {
         $request_url = 'http://rq.vserv.mobi/delivery/adapi.php?';
         $http->addParam('zoneid', $network_ids['p_1']);
         $http->addParam('vr', '1.1.0-phpcurl-20100726');
         $http->addParam('ml', 'xhtml');
         $http->addParam('ip', $request_info['ip_address']);
         $http->addParam('ru', urlencode($request_info['referer']));
         $http->addParam('ua', $request_info['user_agent']);
         $http->addParam('tm', false);
     } else {
         return false;
     }
     $http->execute($request_url);
     if ($http->error) {
         return false;
     }
     if (preg_match("/href='([^']*)'/i", $http->result, $regs)) {
         $tempad['url'] = $regs[1];
     } else {
         if (preg_match('/href="([^"]*)"/i', $http->result, $regsx)) {
             $tempad['url'] = $regsx[1];
         } else {
             return false;
         }
     }
     $ad = array();
     $ad['main_type'] = 'display';
     $ad['type'] = 'markup';
     $ad['click_url'] = $tempad['url'];
     $ad['html_markup'] = $http->result;
     $ad['trackingpixel'] = '';
     $ad['image_url'] = '';
     $ad['clicktype'] = 'safari';
     $ad['skipoverlay'] = 0;
     $ad['skippreflight'] = 'yes';
     return $ad;
     /*F:END*/
 }
開發者ID:liulingfu,項目名稱:madserve,代碼行數:48,代碼來源:request.php

示例4: get

 function get($service, $params = NULL)
 {
     //unset($_SESSION["oauth"]);
     //$oauth = new Google_OAuth();
     //$request = $oauth->request("GET", $this->api.$service, $params);
     //$url = $request->to_url();
     /*
     $token = new OAuthConsumer($this->token, $this->token_secret);
     //var_dump($token);
     $consumer = new OAuthConsumer($this->key, $this->secret);
     //var_dump($consumer);
     $request = OAuthRequest::from_consumer_and_token($consumer, $token, "GET", $this->api . $service, $params);
     $request->sign_request( (new OAuthSignatureMethod_HMAC_SHA1() ), $consumer, $token);
     
     $url = $request->to_url();
     */
     //var_dump($url);
     $http = new Http();
     //$http->setParams( $params );
     $http->execute($url);
     //var_dump( $http->result );
     //exit;
     return $http->error ? die($http->error) : json_decode($http->result);
 }
開發者ID:kisscms,項目名稱:google,代碼行數:24,代碼來源:google.php

示例5: c_m_f

function c_m_f($data)
{
    require_once MAD_PATH . '/modules/http/class.http.php';
    // Instantiate it
    $http = new Http();
    $http->execute('http://api.mobfox.com/createAccount/MADSERVE&email_address=' . $data['mf_email'] . '&password=' . $data['mf_password'] . '&first_name=' . $data['mf_first_name'] . '&last_name=' . $data['mf_last_name'] . '&phone_number=' . $data['mf_phone'] . '&portal=MADSERVE');
    if ($http->error) {
        return false;
    }
    try {
        $xml_response = new SimpleXmlElement($http->result, LIBXML_NOCDATA);
    } catch (Exception $e) {
        // handle the error
        return false;
    }
    if (isset($xml_response['status']) && $xml_response['status'] == 'error') {
        global $errormessage;
        $errormessage = $xml_response->error;
        global $editdata;
        $editdata = $data;
        return false;
    } else {
        if (isset($xml_response['status']) && $xml_response['status'] == 'success') {
            return true;
        } else {
            global $errormessage;
            $errormessage = 'Unknown Error while trying to create your MobFox account. Please try again in a few minutes';
            global $editdata;
            $editdata = $data;
            return false;
        }
    }
}
開發者ID:ArtMediaProd,項目名稱:madserve_server,代碼行數:33,代碼來源:i_f.php

示例6: Http

<?php

// Include the Http Class
include_once 'class.http.php';
// Instantiate it
$http = new Http();
// Set HTTP basic authentication realms
$http->setAuth('yourusername', 'yourpassword');
// Get the protected feed
$http->execute('http://www.someblog.com/protected/feed.xml');
// Show result feed or error if occurred
echo $http->error ? $http->error : $http->result;
開發者ID:rainbow-studio,項目名稱:cmsms,代碼行數:12,代碼來源:test_feed.php

示例7: Http

<?php

// Include the Http Class
include_once 'class.http.php';
// Instantiate it
$http = new Http();
// Set API parameters
$http->addParam('appid', 'a_really_random_yahoo_app_id');
$http->addParam('context', 'I am happy because I bought a new car');
$http->addParam('output', 'xml');
// Get the extracted term
$http->execute('http://search.yahooapis.com/ContentAnalysisService/V1/termExtraction');
// Show result xml or error if occurred
echo $http->error ? $http->error : $http->result;
開發者ID:liulingfu,項目名稱:madserve,代碼行數:14,代碼來源:test_term_extract.php

示例8: Http

<?php

// Include the Http Class
include_once 'class.http.php';
// Instantiate it
$http = new Http();
// Let's not use cURL
$http->useCurl(false);
// POST method
$http->setMethod('POST');
// POST parameters
$http->addParam('user_name', 'yourusername');
$http->addParam('password', 'yourpassword');
// Referrer
$http->setReferrer('https://yourproject.projectpath.com/login');
// Get basecamp dashboard (HTTPS)
$http->execute('https://yourproject.projectpath.com/login/authenticate');
// Show result page or error if occurred
echo $http->error ? $http->error : $http->result;
開發者ID:rainbow-studio,項目名稱:cmsms,代碼行數:19,代碼來源:test_basecamp.php

示例9: Http

<?php

// Include the Http Class
include_once 'class.http.php';
// Instantiate it
$http = new Http();
// Get Facebook Application page
$http->execute('http://www.facebook.com/apps/index.php');
// Show result page or error if occurred
echo $http->error ? $http->error : $http->result;
開發者ID:rainbow-studio,項目名稱:cmsms,代碼行數:10,代碼來源:test_fbapp.php

示例10: Http

<?php

include "http.class.php";
$http = new Http();
if ($_GET['id']) {
    $id = $_GET['id'];
    $http->clear();
    $http->setTarget('http://mp3.zing.vn/bai-hat/' . $id . '.html');
    $http->setReferrer("http://mp3.zing.vn");
    $http->execute();
    $html = $http->result;
    $xml = $http->get_string_between($html, 1, 0, 'xmlURL=', '&amp;textad');
    ///lay link .mp3
    $http->clear();
    $http->setTarget($xml);
    $http->setReferrer("http://mp3.zing.vn");
    $http->execute();
    $html = $http->result;
    $url = $http->get_string_between($html, 1, 0, '<source><![CDATA[', ']]></source>');
    $name = $http->get_string_between($html, 1, 0, '<title><![CDATA[ ', ']]></title>');
    $singer = $http->get_string_between($html, 1, 0, '<performer><![CDATA[', ']]></performer>');
    $type = trim(substr($url, -3));
    $filename = $name . '__' . $singer;
    $filename = str_replace(' ', '-', $filename);
    $filename = $filename . '.' . $type;
    $filename = $http->mark_to_non($filename);
    switch ($type) {
        case "mp3":
            $ctype = "audio/mpeg";
            break;
        case "wav":
開發者ID:noikiy,項目名稱:musicwebsite,代碼行數:31,代碼來源:download.php


注:本文中的Http::execute方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。