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


PHP getRequestParamString函数代码示例

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


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

示例1: sendHttpRequest

/**
 * [WeEngine System] Copyright (c) 2014 WE7.CC
 * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
 */
function sendHttpRequest($params, $url)
{
    $opts = getRequestParamString($params);
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    curl_setopt($ch, CURLOPT_SSLVERSION, 3);
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type:application/x-www-form-urlencoded;charset=UTF-8'));
    curl_setopt($ch, CURLOPT_POSTFIELDS, $opts);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    $html = curl_exec($ch);
    curl_close($ch);
    return $html;
}
开发者ID:legeng,项目名称:project-2,代码行数:20,代码来源:httpClient.php

示例2: sendHttpRequest

/**
 * 后台交易 HttpClient通信
 * @param unknown_type $params
 * @param unknown_type $url
 * @return mixed
 */
function sendHttpRequest($params, $url)
{
    $opts = getRequestParamString($params);
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
    //不验证证书
    curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
    //不验证HOST
    curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type:application/x-www-form-urlencoded;charset=UTF-8'));
    curl_setopt($ch, CURLOPT_POSTFIELDS, $opts);
    /**
     * 设置cURL 参数,要求结果保存到字符串中还是输出到屏幕上。
     */
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
    // 运行cURL,请求网页
    $html = curl_exec($ch);
    // close cURL resource, and free up system resources
    curl_close($ch);
    return $html;
}
开发者ID:wjyGamedev,项目名称:xuezhiweb,代码行数:28,代码来源:httpClient.php

示例3: header

<?php 
header('Content-type:text/html;charset=utf-8');
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/utf8/func/common.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/utf8/func/SDKConfig.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/utf8/func/secureUtil.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/utf8/func/httpClient.php';
include_once $_SERVER['DOCUMENT_ROOT'] . '/upacp_sdk_php/utf8/func/log.class.php';
/**
 *	预授权完成
 */
/**
 *	以下代码只是为了方便商户测试而提供的样例代码,商户可以根据自己需要,按照技术文档编写。该代码仅供参考
 */
// 初始化日志
$log = new PhpLog(SDK_LOG_FILE_PATH, "PRC", SDK_LOG_LEVEL);
$log->LogInfo("===========处理后台请求开始============");
$params = array('version' => '5.0.0', 'encoding' => 'utf-8', 'certId' => getSignCertId(), 'signMethod' => '01', 'txnType' => '03', 'txnSubType' => '00', 'bizType' => '000201', 'accessType' => '0', 'channelType' => '07', 'orderId' => date('YmdHis'), 'merId' => '888888888888888', 'origQryId' => '201502281110005523968', 'txnTime' => date('YmdHis'), 'txnAmt' => '100', 'backUrl' => SDK_BACK_NOTIFY_URL, 'reqReserved' => ' 透传信息');
// 签名
sign($params);
echo "请求:" . getRequestParamString($params);
$log->LogInfo("后台请求地址为>" . SDK_BACK_TRANS_URL);
// 发送信息到后台
$result = sendHttpRequest($params, SDK_BACK_TRANS_URL);
$log->LogInfo("后台返回结果为>" . $result);
echo "应答:" . $result;
//返回结果展示
$result_arr = coverStringToArray($result);
echo verify($result_arr) ? '验签成功' : '验签失败';
?>

开发者ID:184609680,项目名称:wcy_O2O_95180,代码行数:29,代码来源:Form_6_7_3_AuthFinish.php


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