dfi-html/send.php
Christopher 625e49028a 4
2019-03-07 20:17:22 +01:00

24 lines
No EOL
438 B
PHP

<?php
include "mqtt.php";
$mqtt = new phpMQTT("192.168.88.243", 1883, "dynPHPClient");
if ($mqtt->connect(true, NULL, NULL, NULL))
{
$zeilen = explode("\n", $_REQUEST['text']);
$aktuelleZeile = 1;
foreach ($zeilen as $zeile)
{
if($aktuelleZeile <= 4)
$mqtt->publish("/unhb/dfi/".$aktuelleZeile++, $zeile, 0);
}
$mqtt->close();
} else {
echo "Time out!\n";
}
include "index.html";
?>