updated removed
[home-automation.git] / set_climate_status.php
1 <?
2 $device=$_GET['device'];
3 $state=$_GET['state'];
4
5 $fields = array(
6   'node'=>$device,
7   'submit'=>$state
8 );
9
10 foreach($fields as $key=>$value) { $fields_string .= $key.'='.$value.'&'; }
11 rtrim($fields_string,'&');
12
13
14 $ch = curl_init();
15
16 curl_setopt($ch, CURLOPT_URL,"http://isy99/change");
17
18 curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
19 curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);
20 curl_setopt($ch, CURLOPT_USERPWD, 'admin:admin');
21 curl_setopt($ch,CURLOPT_POST,count($fields));
22 curl_setopt($ch,CURLOPT_POSTFIELDS,$fields_string);
23
24
25
26
27 $output = curl_exec($ch);
28
29 #echo "<pre>";
30
31 #print_r($output);
32
33 exit;
34
35 ?>