Tryag File Manager
Home
||
Turbo Force
||
B-F Config_Cpanel
Current Path :
/
home
/
egg.eemo.co.kr
/
public_html
/
super5
/
Or
Select Your Path :
Upload File :
New :
File
Dir
/home/egg.eemo.co.kr/public_html/super5/test_naver_poi.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)); } $client_id = "jVT517A1W_jMGzdoTfaA"; $client_secret = "TzU8_y_RWA"; $encText = urlencode($addr); $url = "https://openapi.naver.com/v1/map/geocode?query=".$encText; // json $is_post = false; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, $is_post); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $headers = array(); $headers[] = "X-Naver-Client-Id: ".$client_id; $headers[] = "X-Naver-Client-Secret: ".$client_secret; curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); $response = curl_exec ($ch); $status_code = curl_getinfo($ch, CURLINFO_HTTP_CODE); echo $response; exit; curl_close ($ch); if($status_code == 200) { $json_dec=json_decode($response); $lon=$json_dec->{'result'}->{'items'}[0]->{"point"}->{"x"}; $lat=$json_dec->{'result'}->{'items'}[0]->{"point"}->{"y"}; $sido=$json_dec->{'result'}->{'items'}[0]->{"addrdetail"}->{"sido"}; $sigungu=$json_dec->{'result'}->{'items'}[0]->{"addrdetail"}->{"sigugun"}; if($sido=="") { echo "<script>alert('주소지 정보가 올바르지 않습니다.');history.back();</script>"; exit; } else { $query="update order_jupsu set suryung_ja='$suryung_ja', order_ja='$order_ja', zipcode='$zipcode', addr='$addr', addr2='$addr2', tel='$tel', cel='$cel', product_name='$product_name', yogu_bigo='$yogu_bigo', pancode='$pancode', sido='$sido', sigungu='$sigungu', lat='$lat', lon='$lon' where no='$no' "; mysql_query($query) or die(mysql_error()); } } else { echo "<script>alert('주소지 정보가 올바르지 않습니다.');history.back();</script>"; exit; } echo "<meta http-equiv='refresh' content='0;url=order_jupsu.php?c_page={$_GET[c_page]}&find={$_GET[find]}&search={$_GET[search]}'>"; ?>