도로명+지번주소 우편번호 검색 > 기술자료 | 해피정닷컴

도로명+지번주소 우편번호 검색 > 기술자료

본문 바로가기

사이트 내 전체검색

도로명+지번주소 우편번호 검색 > 기술자료

ClassicASP 도로명+지번주소 우편번호 검색

페이지 정보


본문

신주소와 지번주소를 함께 검색을 사용하는 소스입니다.

<script type="text/javascript">
  function zipfind(url, field) {
    var opt = "toolbar=no, resizable=yes, scrollbars=yes, location=no, resize=no,menubar=no, directories=no, copyhistory=0, width=600, height=250, top=330, left=370"; 
    window.open(url, 'new_window', opt);
  }
</script>

<form name="hpwrite">
<input type="tex"t name='zip1' size="4" maxlength="3" readonly value='<% 'response.write mb_zip1 %>'>
 -
<input type="text" name='zip2' size="4" maxlength="3" readonly value='<% 'response.write mb_zip2 %>'>
&nbsp;<a href="javascript:zipfind('zipcode.asp', this);"><img width="91" height="20" src="../img/post_search_btn.gif" border=0 align="absmiddle"></a><br />
<input type="text" name='add1' style="width:99%;" readonly="readonly" value='<% 'response.write mb_addr1 %>'><br />
<input type="text" name='add2' style="width:99%;" value='<% 'response.write mb_addr2 %>'>
</form>


### zipcode.asp 내용은 다음과 같습니다.

<%
dim conn
set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=SQLOLEDB.1;Password=디비비밀번호;Persist Security Info=True; User ID=디비아이디; Initial Catalog=디비이름; Data Source=디비주소"

dim tb_zipcode : tb_zipcode = "우편번호테이블이름"

dim ErrNum, MSG
dim TDStyle, str_zip, ErrFlag, i
dim tmp, tmp_zip, tmp_zip1, tmp_zip2
dim sido, gugun, dong, ri, bunji, road, road_building, road_dong

 ErrNum = sqlCheck(Trim(Request("ErrNum")))

 IF ErrNum <> "" Then
  Select Case ErrNum
   Case "0011"
    MSG = "<div style='padding: 10px 0 0 30px; color:#f51515;'>해당 검색어에 해당하는 우편번호가 존재하지 않습니다.</div>"
  End Select
 End IF

 TDStyle = "border-bottom: black 1px solid; border-left: black 1px solid; border-right: black 1px solid; border-top: black 1px solid; "

' 인젝션 방지관련 https://www.happyjung.com/bbs/board.php?bo_table=lecture&wr_id=480
'function sqlCheck(str)
'...
'end function

 str_zip = sqlCheck(Trim(Request("str_zip")))
 
 IF  len(str_zip) >= 2  then
  SQL="SELECT * from "& tb_zipcode &" Where dong like '%"& str_zip &"%' or road like '%"& str_zip &"%' "
  Set Rs=conn.Execute(SQL)
  IF Rs.EOF Then
   ErrFlag = True
   ErrNum  = 0011

   Response.Redirect "zipcode.asp?ErrNum=0011"
   Response.End
  End IF
 End IF
%>
<html>
<head>
<title>우편번호 찾기</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<style>
body { margin: 0; font-size:12px; overflow-x: hidden; overflow-y: auto; }
td { font-size:12px; }
a:link   { font-family:"돋움"; text-decoration:none; color:#000000; line-height: 18px;}
a:active  { font-family:"돋움"; text-decoration:none; color:#000000; line-height: 18px;}
a:visited  { font-family:"돋움"; text-decoration:none; color:#000000; line-height: 18px;}
a:hover  { font-family:"돋움"; text-decoration:underline;  color:#000000; line-height: 18px;}
</style>
<script language="javascript">
<!--
function GoSearch() {
    fom = document.forms[0];
 if ( document.InSearch.str_zip.value == ""  ) {
   alert("기재하고 싶은 주소를 선택하세요!");
      fom.str_zip.focus();
   return;
 }
 if (document.InSearch.str_zip.value.length <= 1) {
     alert("주소입력은 2자리 이상이어야 합니다!");
     fom.str_zip.focus();
     return;
 }
 document.InSearch.submit();
}
//-->
</script>

<script type="text/javascript">
<!--
function copy(tmp_zip1, tmp_zip2, c, d) {
  opener.hpform.zip1.value = tmp_zip1;
  opener.hpform.zip2.value = tmp_zip2;
  opener.hpform.add1.value = c;
  opener.hpform.add2.value = d;
  //opener.hpform.add2.focus();
  window.close();
}
//-->
</script>
</head>

<body>
<TABLE cellSpacing=0 cellpadding="2" style="BORDER-COLLAPSE: collapse" width="97%">
<%
if  len(str_zip) >= 2 then
  i = 0
  Do While Not Rs.EOF
    'response.write rs("zipcode")
    tmp_zip = rs("zipcode")
    tmp = split(tmp_zip,"-")
    tmp_zip1 = tmp(0)
    tmp_zip2 = tmp(1)
    sido = rs("sido")
    gugun = rs("gugun")
    dong = rs("dong")
    ri = rs("ri")
    bunji = rs("bunji")
    road = rs("road")
    road_building = rs("road_building")
    road_dong = rs("road_dong")
%>
 <tr height="20" onmouseover="this.style.backgroundcolor='#EFEFEF'" onmouseout="this.style.backgroundcolor='#FFFFFF'">  
  <td height="30" style="<%=TDStyle%>">
          <a href="#" onclick="copy('<%
            response.write tmp_zip1 %>','<% response.write tmp_zip2 %>','<%
            response.write sido &"&nbsp;"
            if gugun <> "" then
              response.write gugun &"&nbsp;"
            end if
            if dong <> "" then
              response.write dong &"&nbsp;"
            end if
            if ri <> "" then
              response.write ri &"&nbsp;"
            end if

            if road <> "" then
              response.write road &"&nbsp;"
            end if
          %>','<%
            if road <> "" then
              if road_building <> "" then
                response.write road_building &"&nbsp;"
              end if
              if road_dong <> "" then
                response.write "("& road_dong &")"
              end if 
            end if
          %>')">
          <%
            response.write "["& tmp_zip1 &"-"& tmp_zip2 &"] "
            response.write sido &"&nbsp;"
            if gugun <> "" then
              response.write gugun &"&nbsp;"
            end if
            if dong <> "" then
              response.write dong &"&nbsp;"
            end if
            if ri <> "" then
              response.write ri &"&nbsp;"
            end if

            if road <> "" then
              response.write road &"&nbsp;"
              response.write bunji &"&nbsp;"
              if road_building <> "" then
                response.write road_building &"&nbsp;"
              end if
              if road_dong <> "" then
                response.write "("& road_dong &")"
              end if
            else
              response.write bunji &"&nbsp;"   
            end if
          %></a></td>
 </tr>           
<%
    Rs.MoveNext
    i = i + 1
  Loop

 conn.Close
 Set conn = Nothing
end if
%>
</table>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><img src="../img/zipcode_top.gif" /></td>
    </tr>
  <tr>
    <td background="../img/zipcode_middle.gif" style="padding-top:10px;">
      <form name="InSearch" method="post" action="zipcode.asp" style="padding:0; margin:0;">
         <table width="400" border="0" align="center" cellpadding="0" cellspacing="0">
           <tr>
              <td align="center">
                <input name="str_zip" class="input_box">
                <img  src="../img/zipcode_submit.gif" align="absmiddle" onclick="GoSearch();" /></td>
           </tr>
         </table>
      </form>
   <%= MSG %>
   <table width="400" border="0" align="center" cellpadding="4" cellspacing="0">
    <tr>
     <td style="padding-top:10px;">
     검색창에서 읍, 면, 동, 도로명 이름중 한가지만 입력하십시요.<br />
     ex) 구로동, 역삼, 디지털로
     </td>
    </tr>
    <tr align="center">
     <td colspan="2"><img src="../img/zipcode_close.gif" onclick="self.close();"border="0" /></td>
    </tr>
   </table></td>
    </tr>
  <tr>
    <td><img src="../img/zipcode_bottom.gif" /></td>
  </tr>
</table>
</body>
</html>


도로명+지번주소 우편번호 : https://www.happyjung.com/bbs/board.php?bo_table=lecture&wr_id=1366 

댓글목록

등록된 댓글이 없습니다.


Total 2,634건 67 페이지
  • RSS
기술자료 목록
1314
MySQL   19057  2013-02-18 20:53  
1313
.NET   22021  2013-02-18 12:40  
1312
일반   12677  2013-02-16 01:23  
1311
일반   14823  2013-02-16 01:12  
1310
일반   24612  2013-02-16 00:48  
1309
MSSQL   18134  2013-02-15 20:07  
1308
그누보드   14188  2013-02-14 13:35  
1307
ClassicASP   17281  2013-02-13 21:34  
1306
ClassicASP   16465  2013-02-05 11:38 ~ 2014-04-28 00:00  
1305
JavaScript   18186  2013-02-05 11:27  
1304
ClassicASP   23172  2013-02-04 17:56  
1303
전자결제   17470  2013-02-02 18:21  
열람
ClassicASP   22318  2013-02-02 14:28  
1301
ClassicASP   19483  2013-02-01 20:56  
1300
etc언어   16868  2013-02-01 11:53  
1299
ClassicASP   17344  2013-01-31 02:14  
1298
MSSQL   17204  2013-01-31 01:40  
1297
일반   18201  2013-01-31 00:26 ~ 2013-02-02 00:00  
1296
JavaScript   15003  2013-01-28 00:42  
1295
일반   12218  2013-01-27 10:51  

검색

해피정닷컴 정보

회사소개 회사연혁 협력사 오시는길 서비스 이용약관 개인정보 처리방침

회사명: 해피정닷컴   대표: 정창용   전화: 070-7600-3500   팩스: 042-670-8272
주소: (34368) 대전시 대덕구 대화로 160 대전산업용재유통단지 1동 222호
개인정보보호책임자: 정창용   사업자번호: 119-05-36414
통신판매업신고: 제2024-대전대덕-0405호 [사업자등록확인]  
Copyright 2001~2024 해피정닷컴. All Rights Reserved.