1

向webmoney 商家发送POST 后,出现错误:

该页无法显示

您要查找的页面有问题,无法显示。如果您尝试显示驻留在配置为仅允许执行或脚本权限的目录中的 HTML 页面,则可能会发生此错误。请尝试以下方法:

如果您认为该目录应允许读取访问权限,请联系网站管理员。HTTP 错误 403.2 - 禁止:读取访问被拒绝。互联网信息服务 (IIS)

技术信息(支持人员)

转到 Microsoft 产品支持服务并执行 HTTP 和 403 字样的标题搜索。打开 IIS 帮助(可在 IIS 管理器 (inetmgr) 中访问),然后搜索标题为“使用虚拟目录”、“更改默认网站设置”和“关于自定义”的主题错误消息。

代码:

$param = array(
    'LMI_PAYMENT_AMOUNT' => '2',
    'LMI_PAYMENT_DESC' => 'Return a debt by invoice',
    'LMI_PAYMENT_NO' => rand(0, 9999),
    'LMI_PAYEE_PURSE' => 'Z401998872708',
    'LMI_SIM_MODE' => '0',
);

//
$url = "https://merchant.webmoney.ru/lmi/payment.asp";
$post = "LMI_PAYEE_PURSE=Z401998872708&LMI_PAYMENT_AMOUNT=1&LMI_PAYMENT_DESC=Return a debt by invoice";
$user_agent = "Mozilla/5.0 (Windows NT 5.1; rv:2.0) Gecko/20100101 Firefox/4.0";
$referer = "https://merchant.webmoney.ru/lmi/payment.asp";
$pathCerts="/mnt/d/web/test/WMunited.cer";
//
$ch = curl_init();

curl_setopt($ch, CURLOPT_VERBOSE, 0);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, 0);

curl_setopt ($ch, CURLOPT_URL, $url);
curl_setopt ($ch, CURLOPT_USERAGENT, $user_agent);
curl_setopt ($ch, CURLOPT_POST, 1);
curl_setopt ($ch, CURLOPT_POSTFIELDS, $param);
curl_setopt ($ch, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt ($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt ($ch, CURLOPT_REFERER, $referer);
curl_setopt($ch, CURLOPT_CAINFO, $pathCerts);
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, TRUE);

curl_setopt($ch, CURLOPT_COOKIEJAR, $_SERVER['DOCUMENT_ROOT'].'/cookies.txt');//куки сохранить
curl_setopt($ch, CURLOPT_COOKIEFILE,$_SERVER['DOCUMENT_ROOT'].'/cookies.txt');
//  curl_setopt ($ch, CURLOPT_ ,);
//  curl_setopt ($ch, CURLOPT_ ,);
$result = curl_exec ($ch);

echo $str = str_replace ("<head>","<head><base href = 'https://merchant.webmoney.ru/lmi/'>", $result);
4

0 回答 0