Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
nonga.eemo.co.kr
/
public_html
/
www
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/nonga.eemo.co.kr/public_html/www/farm_iot_dong_set_do.php
<? session_cache_limiter('no-cache, must-revalidate'); session_start(); header("Pragma: no-cache"); header("Cache-Control: no-cache,must-revalidate"); header("Content-Type: text/html; charset=utf-8"); include_once("dbconn.php"); include_once("lib.php"); foreach($_GET as $key => $value) { ${$key}=mysql_real_escape_string(trim($value)); } foreach($_POST as $key => $value) { ${$key}=mysql_real_escape_string(trim($value)); $exp_tmp=explode("_",$key); if(sizeof($exp_tmp)==4) { $sensor_no=$exp_tmp[1]; $colname="set_".$exp_tmp[2]."_".$exp_tmp[3]."_value"; mysql_query("update farm_sensor set $colname = '$value' where no='$sensor_no' ") or die(); } else if(sizeof($exp_tmp)==3) { $sensor_no=$exp_tmp[1]; $colname="set_anal_".$exp_tmp[2]."_value"; mysql_query("update farm_sensor set $colname = '$value' where no='$sensor_no' ") or die(); } } $arr_rst['rst']='1'; echo urldecode(json_encode($arr_rst)); ?>