Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/36.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在php中发布对外部url的响应_Php_Forms_Post_Response_Payment - Fatal编程技术网

在php中发布对外部url的响应

在php中发布对外部url的响应,php,forms,post,response,payment,Php,Forms,Post,Response,Payment,我有一个网站,在那里我得到付款处理程序发送的付款响应。我的页面是https,而我的客户页面不是 我以这种方式发布付款回复 echo '<html>Redirecting to merchants website..<body> <form id="myForm" action="'.$response_url.'" method="POST"> <input type="hidden" name="status" value="'.$response['

我有一个网站,在那里我得到付款处理程序发送的付款响应。我的页面是https,而我的客户页面不是

我以这种方式发布付款回复

echo '<html>Redirecting to merchants website..<body>
<form id="myForm" action="'.$response_url.'" method="POST">
<input type="hidden" name="status" value="'.$response['status'].'"/>
<input type="hidden" name="customerReferenceNo" value="'.$data['customerReferenceNo'].'"/>
<input type="hidden" name="amount" value="'.$data['amount'].'"/>
<input type="hidden" name="paymentMode" value="'.$data['paymentMode'].'"/>
<input type="hidden" name="cardProvider" value="'.$data['cardProvider'].'"/>
<input type="hidden" name="orderID" value="'.$orderID.'"/>
<input type="hidden" name="mobileNo" value="'.$mobileNo.'"/>
<input type="hidden" name="email" value="'.$email.'"/>
</form>

<script>document.getElementById("myForm").submit();</script></body></html>';
echo'重定向到商家网站。。
document.getElementById(“myForm”).submit();';
作为隐藏表单post。但当Iam将值从https发布到http页面时,其在某些浏览器中弹出的安全警告如下:

虽然此页面已加密,但您输入的信息将被发送 通过未加密的连接,并且可以很容易地被第三方读取

您确定要继续发送此信息吗

我想知道这是否是将响应发布到外部url的正确方式?我所做的是正确的吗?这是我应该将支付响应发布到外部url的正确方式吗


请提供一些建议

如上面评论中所述,您一定要注意发回https站点。但与其将隐藏的表单输出到浏览器并在那里发布,不如使用curl,直接将数据从服务器发送到支付处理器。
请参见

您正在将表单加载到
https://...
页面,但正在将其提交到http://(无S)。无论何时提交安全->不安全,您都会收到该警告,即使该不安全页面完全是外来页面。这是一种安全机制,您不应该绕过它。您想将用户重定向回响应url还是只通知响应url付款?我想将数据发布到外部url并重定向到外部url。@Kypros在发布时,我的客户可以在oage Im重定向中显示付款状态,浏览器会发出警告为了安全和正当理由。它应该在那里。您应该做的是使用类似CURL的方法将支付结果发布到http站点上只记录支付结果的页面。然后将它们重定向回可以检查其状态的其他站点。通常通过id。当他们被重定向到您的站点进行处理时,让另一个站点向您发送他们客户的唯一id。然后将该id与回复一起发回。重定向到其他网站,他们应该有id。我对你所说的有疑问。如果我使用curl将响应发布到他们提供的url,然后使用header或其他方法重定向到saem url,他们是否能够显示我传递的响应?这可能取决于支付服务和发布数据后你想要显示的内容。您将在php代码中返回结果。我当然不知道结果会怎样。因此,您可以显示一些信息,也可以重定向到一个url。