2 require_once 'config_local.php';
4 $client_ip = ip2long($_SERVER["REMOTE_ADDR"]);
6 if (!client_ip || $client_ip > $valid_ip_end || $valid_ip_start > $client_ip) {
7 header('HTTP/1.1 403 Forbidden');
8 echo "IP not in allowed range";
12 $stype = $_REQUEST['stype'];
13 $sid = $_REQUEST['sid'];
14 $param = $_REQUEST['param'];
15 $value = $_REQUEST['value'];
17 $connection = new mysqli($mysql_host, $mysql_user, $mysql_pwd, $mysql_schema, $mysql_port);
18 if ($connection->connect_errno) {
19 header('HTTP/1.1 500 Internal Server Error');
23 $str = "CALL meteo.submit_value('".$stype."','".$sid."','".$param."',".$value.",NULL)";
24 if (!$connection->query($str)) {
25 header('HTTP/1.1 500 Internal Server Error');
28 $connection->commit();
32 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
33 <title>Meteo logger</title>