dfi-html/send.php

24 lines
438 B
PHP
Raw Normal View History

2019-03-07 20:13:50 +01:00
<?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)
{
2019-03-07 20:17:22 +01:00
if($aktuelleZeile <= 4)
2019-03-07 20:13:50 +01:00
$mqtt->publish("/unhb/dfi/".$aktuelleZeile++, $zeile, 0);
}
$mqtt->close();
} else {
echo "Time out!\n";
}
include "index.html";
?>