Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
ltman.eemo.co.kr
/
public_html
/
www_
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/ltman.eemo.co.kr/public_html/www_/farm_wifi_add_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)); } $arr_rst=array(); $vv2=str_replace("-","",$farm_code); $rs=RS("select * from farm where REPLACE(farm_code,'-','')='$vv2' "); $is_rs=RS("select * from wifi_device where farm_no='{$rs[farm_no]}' and vcode='$wifi_vcode' "); if($is_rs[no]) { $arr_rst['rst']='double'; echo json_encode($arr_rst); exit; } $query="insert into wifi_device set farm_no='{$rs[no]}', farm_code='$farm_code', dong_name='$dong_name', regdate=now() "; mysql_query($query) or die(mysql_error()); $rs_cnt=RS("select count(no) as cnt from farm_dong_info where REPLACE(farm_code,'-','')='$vv2' "); mysql_query("update farm set house_num='{$rs_cnt[cnt]}' where REPLACE(farm_code,'-','')='$vv2' ") or die(); $arr_rst['rst']='1'; $arr_rst['code']=$rs[farm_code]; echo json_encode($arr_rst); ?>