Jelenlegi hely

Light switch

$light = $_GET['light'];
if($light == "on") {
$file = fopen("http://185.51.67.19/~terrapeu/light.json", "w") or die("can't open file");
fwrite($file, '{"light": "on"}');
fclose($file);
}
else if ($light == "off") {
$file = fopen("http://185.51.67.19/~terrapeu/light.json", "w") or die("can't open file");
fwrite($file, '{"light": "off"}');
fclose($file);
}
?>





LED for ESP8266


Turn On

Turn Off
if($light=="on") {
echo("Turn LED on.");
}
else if ($light=="off") {
echo("Turn LED off.");
}
else {
echo ("Do something.");
}
?>


Drupal alapú webhely

Jelenlegi hely