2 $device=$_GET['device'];
10 foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
11 rtrim($fields_string,'&');
15 if ("nodes"==substr($device,0,5)) {
16 $string="http://isy99/rest/nodes/".rawurlencode(substr($device,-10))."/cmd/$state";
23 $string="http://isy99/rest/programs/".rawurlencode(substr($device,-4))."/$state";
25 curl_setopt($ch, CURLOPT_URL,"$string");
30 #echo "http://isy99/rest/nodes/$device/cmd/$state";
32 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
33 curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
34 curl_setopt($ch, CURLOPT_USERPWD, 'admin:admin');
35 curl_setopt($ch, CURLOPT_HEADER, 0);
36 #curl_setopt($ch,CURLOPT_POST,count($fields));
37 #curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
41 $output = curl_exec($ch);