Я использую curl в своей программе.
и мой код:получить запрос на завивание
$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