<?php
// if(isset($_POST['submit'])){

 // A sample PHP Script to POST data using cURL
 
//   $authorization = "Authorization: Bearer 080042cad6356ad5dc0a720c18b53b8e53d4c274";
//   $data = array(
//       'Content-Type' => 'application/json',
//       'Authorization' => 'Bearer p8No4wK354ANCP2M6-vzBREKGrIMOIdQdNtiXTchqCEdKNPeoiiRciwynprSX4c_WjoRAB7TUJMp1D4p6s05xVazqrohfhNcg6VBGfjn-NGsUnmVsUEjqur0Sfk8vB8Zd6B3SUsZhew88Hnq7ips9_FbuqVzN0SiTe5n9rhV6fJi7Hj5NfhYH5LWwvzAKCrTBsucwigxofCpLLqBIwoF0dTDxIbH-sYOpYYn8pa31Rz70vqTrtljIKQz9-hyx9HRFf9DhPYj4ENu9SfREivV9nZo5N-Zh5NrNv3Prt0hoV4BIk6AJ-oV_YOpM8woJmccofWbfgcXY0Vm_ifa7cNgy2Q0g-Cw7AecEls04b9eb_pJUwsq9tScbPoDGF_bj976X9vXkKU_ZtBJs_gV5h5rlC8B67o6K6CcMDeTAhllAM-9KVNM62pjzOfGBV0d0pV70Jl7VPVZSHWDsqXE58qOMSr2k86FwB6ZSp1HLDjb0bihLdrZc8TuKKUErjuJxqkRGEgUqkmPcJINx2vecA9gmA',
//   );
   
//   $post_data = json_encode($data);
   
//   // Prepare new cURL resource
//   $crl = curl_init('http://3.120.90.17:9191/GetCountry');
//   curl_setopt($crl, CURLOPT_RETURNTRANSFER, true);
//   curl_setopt($crl, CURLINFO_HEADER_OUT, true);
//   curl_setopt($crl, CURLOPT_POST, true);
//   curl_setopt($crl, CURLOPT_POSTFIELDS, $post_data);
   
//   // Set HTTP Header for POST request 
//   curl_setopt($crl, CURLOPT_HTTPHEADER, array(
//       'Content-Type: application/json',
//       'Content-Length: ' . strlen($payload))
//   );
   
//   // Submit the POST request
//   $result = curl_exec($crl);
   
//   // handle curl error
//   if ($result === false) {
//       // throw new Exception('Curl error: ' . curl_error($crl));
//       print_r('Curl error: ' . curl_error($crl));
//       $result_noti = 0; 
//     //   die();
//   } else {

//       $result_noti = 1; 
//     //   die();
//   }
//   // Close cURL session handle
//   curl_close($crl);
  
//   echo $result_noti;
// // }

// $ch = curl_init();

// curl_setopt($ch, CURLOPT_URL, 'http://3.120.90.17:9191/GetAccountBalance');
// curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
// curl_setopt($ch, CURLOPT_POST, 1);

// $headers = array();
// $headers[] = 'Content-Type: application/json';
// $headers[] = 'Authorization: Bearer p8No4wK354ANCP2M6-vzBREKGrIMOIdQdNtiXTchqCEdKNPeoiiRciwynprSX4c_WjoRAB7TUJMp1D4p6s05xVazqrohfhNcg6VBGfjn-NGsUnmVsUEjqur0Sfk8vB8Zd6B3SUsZhew88Hnq7ips9_FbuqVzN0SiTe5n9rhV6fJi7Hj5NfhYH5LWwvzAKCrTBsucwigxofCpLLqBIwoF0dTDxIbH-sYOpYYn8pa31Rz70vqTrtljIKQz9-hyx9HRFf9DhPYj4ENu9SfREivV9nZo5N-Zh5NrNv3Prt0hoV4BIk6AJ-oV_YOpM8woJmccofWbfgcXY0Vm_ifa7cNgy2Q0g-Cw7AecEls04b9eb_pJUwsq9tScbPoDGF_bj976X9vXkKU_ZtBJs_gV5h5rlC8B67o6K6CcMDeTAhllAM-9KVNM62pjzOfGBV0d0pV70Jl7VPVZSHWDsqXE58qOMSr2k86FwB6ZSp1HLDjb0bihLdrZc8TuKKUErjuJxqkRGEgUqkmPcJINx2vecA9gmA';
// curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);

// $result = curl_exec($ch);
// if (curl_errno($ch)) {
//     echo 'Error:' . curl_error($ch);
// }
// curl_close($ch);



    $host = '3.120.90.17'; 
    $port = 9898; 
    $waitTimeoutInSeconds = 5; 
    if($fp = fsockopen($host,$port,$errCode,$errStr,$waitTimeoutInSeconds)){   
    echo "Connected";
    } else {
    echo "Unable to connect"; 
    } 
    fclose($fp);

?>