Answer the question
In order to leave comments, you need to log in
Why does cURL work locally, but not on hosting?
Good afternoon!
Straight to the point:
There is a script:
if($_GET['method'] == 'register')
{
if(isset($_GET['amount']) & isset($_GET['guest_name']) & isset($_GET['phone']) & isset($_GET['room']) & isset($_GET['arrival']))
{
if(!empty($_GET['amount']) & !empty($_GET['guest_name']) & !empty($_GET['phone']) & !empty($_GET['room']) & !empty($_GET['arrival']))
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $main_server.$register.'?userName='.$merchant['login'].'&password='.$merchant['password'].'&amount='.$_GET['amount'].'&orderNumber='.$orderNumber.'&returnUrl='.$returnUrl);
curl_setopt($ch, CURLOPT_HEADER, false);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 30);
curl_setopt($ch, CURLOPT_USERAGENT, 'PHP Gateway ');
curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);
curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);
$data = curl_exec($ch);
curl_close($ch);
$data_arr = json_decode($data, true);
if(isset($data_arr['errorCode']) & !empty($data_arr['errorCode']))
{
die('Произошла ошибка: ' . $data_arr['errorCode'] . ' : ' . $data_arr['errorMessage']);
}
else
{
header("Location: " . $data_arr['formUrl']);
exit();
}
}
else
{
die("Один или несколько параметров пусты");
}
}
else
{
die("Один или несколько параметров не заданы");
}
}
error_reporting(E_ALL);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question