我在我的程序中使用卷曲。
和我的代码是:收到卷曲请求
$tref = $_GET['tref'];
$url = "https://paypaad.bankpasargad.com/PaymentTrace";
$curl_session = curl_init($url); // Initiate CURL session -> notice: CURL should be enabled.
curl_setopt($curl_session, CURLOPT_POST, 1); // Set post method on.
//curl_setopt($curl_session, CURLOPT_FOLLOWLOCATION, 1); // Follow where ever it goes
curl_setopt($curl_session, CURLOPT_HEADER, 0); //Don't return http headers
//curl_setopt($curl_session, CURLOPT_RETURNTRANSFER, 1); // Return the content of the call
$post_data = "tref=".$tref;
curl_setopt($curl_session, CURLOPT_POSTFIELDS, $post_data);
// Get returning data
$output = curl_exec($curl_session);
print_r($output);
print_r($post_data);
,但是当我在我的主机使用此代码,$output
没有设置,当另一台服务器使用此代码正确。
我在我的服务器上如何做。
你可以选择你自己的答案。请这样做,所以社区知道它已经解决了,而有同样问题的人看到它已经解决了。 – 11684