<?php
$qryApi = mysqli_query($conn,"SELECT * FROM api_setting");
$apidata = mysqli_fetch_array($qryApi);

$apikey = $apidata['APIkey']; //email address()
$url = $apidata['baseurl'];

$site = $_SERVER['SERVER_NAME'];

$request_dir = $_SERVER['SERVER_NAME'] . dirname($_SERVER['REQUEST_URI']);

$host = "https://$url/api/airtime-cash/?apikey=$apikey&site=$request_dir&network=$network&sender=$email&sendernumber=$phone&amount=$xamount&ref=$requestId";




//Initialize cURL.
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $host);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);

$dataR = curl_exec($ch);
$result = json_decode($dataR);

//Close the cURL handle.
curl_close($ch);

//echo $dataR;



$resp = json_decode($dataR);

$message = $result->description->message;


?>