$ua = 'User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Widows NT)';
$url = "https://sites.ru/api/index.php?key=apikey&action=create&service=295&quantity=1&link=111";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_urlERER, $url);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $ua);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$buf = curl_exec ($ch);
curl_close ($ch);
echo $buf;
$ua = 'User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Widows NT)';
$url = "https://sites.ru/api/index.php?key=apikey&action=create&service=295&quantity=1&link=111";
$ch = curl_init($url);
curl_setopt($ch, CURLOPT_HEADER, 0);
curl_setopt($ch, CURLOPT_urlERER, $url);
curl_setopt($ch, CURLOPT_FAILONERROR, 1);
curl_setopt($ch, CURLOPT_USERAGENT, $ua);
curl_setopt($ch, CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch, CURLOPT_TIMEOUT, 3);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
$buf = curl_exec ($ch);
curl_close ($ch);
echo $buf;
$SHOP_ID = "ид магазина";
$REST_ID = "апи ид";
$PWD = "пароль апи";
$id =trim($_POST['bill_id']);
$status =trim($_POST['status']);
$error =trim($_POST['error']);
$amount =trim($_POST['amount']);
$user =trim($_POST['user']);
$prv_name =trim($_POST['prv_name']);
$ccy =trim($_POST['ccy']);
$comment =trim($_POST['comment']);
$command =trim($_POST['command']);
$head =apache_request_headers();
$hash =$_SERVER['HTTP_X_API_SIGNATURE'];
$hash_gen = base64_encode(hash_hmac("sha1", $id.'|'.$ccy.'|'.$command.'|'.$comment.'|'.$error.'|'.$prv_name.'|'.$status, $PWD, $raw_output=TRUE));
if($hash_gen!=$hash){
exit();
}else{
$balans = mysql_query("UPDATE `users` SET `UserBalance`=`UserBalance` + '$amount' WHERE `UserID`='$comment'");
header("HTTP/1.1 200 OK");
header('content-type: text/xml; charset=UTF-8');
echo '<!--xml version="1.0"?--><result><result_code>0</result_code></result>';
exit; }
<html>
<head>
<title>dsgsg</title>
</head>
<body>
<form action="">
<p><input name="radiobutton" type="radio" value="1" checked>1</p>
<p><input name="radiobutton" type="radio" value="2">2</p>
<p><input name="radiobutton" type="radio" value="3">3</p>
</form>
<div class="container">
<div class="block active" data-id="1">1</div>
<div class="block" data-id="2">2</div>
<div class="block" data-id="3">3</div>
</div>
<style>
.block {
display: none;
width: 50px;
height: 50px;
border: 1px solid red;
text-align: center;
line-height: 50px;
}
.block.active {
display: block;
}
</style>
<script>
$('form').on('click', 'input[type="radio"]', function(e) {
$('.block').removeClass('active');
$('.block[data-id="' + e.target.value + '"]').addClass('active');
})
</script>
</body>
</html>
это получаю в $result
{"orders":{"7690218":{"id":"7690218","obj":"wall35173603_613","act":"vk_like","status":"works","timeout":"10","count":"5","count_good":"0","start":"16:21 06.09.2018","criterion":"no"}}}
нужны значения status и count_good
это число "7690218" если что хранится у меня в данной переменной
$orderapi