我正在开发一个PHP
链接到的应用程序Protx VSP Direct payment gateway
.要处理来自信用卡处理公司的"3D安全"请求,我需要将用户转发到其他网站,模仿已发布的表单.我正在尝试使用这些cURL
库,但似乎遇到了问题.我的代码如下:
<?php
$ch = curl_init();
// Set the URL
curl_setopt($ch, CURLOPT_URL, 'http://www.google.com/');
// Perform a POST
curl_setopt($ch, CURLOPT_POST, 1);
// If not set, curl prints output to the browser
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 0);
// Set the "form fields"
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields);
$output = curl_exec($ch);
curl_close($ch);
?>
Run Code Online (Sandbox Code Playgroud)
所有这一切都是抓取传递的URL的内容,而不是将用户转发到任何地方.我尽可能多地尝试谷歌搜索和阅读,但无法弄清楚我错过了什么.有任何想法吗?我不想创建一个自动提交自己的HTML表单,如果我可以避免它.
谢谢你的帮助 :-)