24 lines
No EOL
438 B
PHP
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";
|
|
?>
|