<?php
$host = "c219um.forpsi.com";
$user = "x";
$pass = "XX";
$database = "XX";

//prihlaseni do db
$mysqli = new mysqli ($host, $user, $pass, $database);
if ($mysqli->connect_errno) {
  die ("Connect failed: %s\n". $mysqli->connect_error);
}
//promena pro ulozeni aktualniho data do databaze
$timestamp = date("Y-m-d H:i:s");
$teplota = $_POST["cislo4"]/100;
//vlozeni zaznamu do db
$sql = "INSERT INTO data (id, cas, cislo1, cislo2, cislo3, cislo4) VALUES " . "('" .$_POST['id'] . "','$timestamp','" .$_POST["cislo1"] . "','" .$_POST['cislo2']. "','" .$_POST["cislo3"]. "','$teplota')";
if ($mysqli->query($sql) === TRUE) {
    echo "New record created successfully "."<br>"."$timestamp";
} else {
    echo "Error: " . $sql . "<br>" . $mysqli->error;
}
$mysqli->close();

?> 