<?php
$fields = array(
'auth_login' => "clic.display@yandex.ru",
'auth_token' => "bbntf2ege3vz2p6b2e6a3ue435x07lu4fax4zv52c7ba4cj5as46q3g388x5x3p2",
'class' => "hosting_mailbox",
'method' => "create",
'account' => "clicinde",
'mailbox' => $_POST['mailbox'],
'password' => $_POST['password'],
);
$fields_string = "";
foreach($fields as $key => $value) {
$fields_string .= $key.'='.urlencode($value).'&';
}
rtrim($fields_string, '&');
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, "https://adm.tools/api.php");
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_POST, count($fields));
curl_setopt($ch, CURLOPT_POSTFIELDS, $fields_string);
curl_setopt($ch);
$response = curl_exec($ch);
curl_close($ch);
$json_string = 'https://adm.tools/api.php';
$jsondata = file_get_contents($json_string);
$response = json_decode($response,true);
echo "<pre>";
print_r($response);
if ($response['status'] === 'error') {
$redirect_url = "/new";
} else {
$redirect_url = "/new/skype.html";
}
?>