File: /home/posscale/subdomains/Mondo-Statements/index.php
<?php
$url = 'https://api.mondotalk.com/myaccount/v1/myaccountstatement/';
// https://api.mondotalk.com/myaccount/v1/login/
// https://api.mondotalk.com/myaccount/v1/ myaccountstatement/
$params = array(
'id' => '8340929',
'key' => '{5B1C32E9-245C-1A82-0279-8EAC912DB675}',
'username' => '8340929',
'password' => '9yaPVp@t',
// 'type' => 'text',
// 'price' => 0,
// 'data' => utf8_encode('Hello, world! (�����)')
);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch, CURLOPT_TIMEOUT, 60);
// This should be the default Content-type for POST requests
//curl_setopt($ch, CURLOPT_HTTPHEADER, array("Content-type: application/x-www-form-urlencoded"));
// $result = curl_exec($ch);
// if(curl_errno($ch) !== 0) {
// error_log('cURL error when connecting to ' . $url . ': ' . curl_error($ch));
// }
// curl_close($ch);
// print_r($result);
?>
<html>
<body>
<form action = "#" method = "post">
<!-- Account: <input type = "text" name="id" value="8340929" />
<input type="hidden" name="key" value="{5B1C32E9-245C-1A82-0279-8EAC912DB675}" />
<input type="hidden" name="username" value="8340929" />
<input type="hidden" name="password" value="9yaPVp@t" />
--> <input type = "submit" />
</form>
</body>
</html>
<?php
$result = curl_exec($ch);
if(curl_errno($ch) !== 0) {
error_log('cURL error when connecting to ' . $url . ': ' . curl_error($ch));
}
curl_close($ch);
print_r($result);
?>