some minor changes

This commit is contained in:
telegnom
2015-04-05 13:17:50 +02:00
parent b4de30f825
commit 101f78be57
2 changed files with 16 additions and 16 deletions

View File

@ -1,14 +1,14 @@
<?php
if (preg_match("/^[0-9]{10}\.[0-9]{0,2};[0-9]{1,5}\.[0-9]{0,20}$/", $_POST['val'])) {
$val = explode(";", $_POST['val']);
$updator = new RRDUpdater("power.rrd");
$updator->update(array("power" => $val[1]), $val[0]);
$fileh = fopen("power.log", "w+");
fwrite($fileh, $_POST['val']);
fclose($fileh);
echo "0";
} else {
echo "1";
}
if (preg_match("/^[0-9]{10}\;[0-9]{1,5}\.?[0-9]{0,20}/", $_POST['val'])) {
$val = explode(";", $_POST['val']);
$updator = new RRDUpdater("power.rrd");
$updator->update(array("power" => $val[1]), $val[0]);
$fileh = fopen("power.log", "w+");
fwrite($fileh, $_POST['val']);
fclose($fileh);
echo "0";
} else {
echo "1";
}
?>