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

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

본문 바로가기

사이트 내 전체검색

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

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 198건 3 페이지
  • RSS
기술자료 목록
158
ClassicASP   18167  2013-04-26 09:13  
157
ClassicASP   21942  2013-04-07 02:12  
156
ClassicASP   15640  2013-03-26 22:55 ~ 2020-05-05 13:10  
155
ClassicASP   22277  2013-03-07 22:16 ~ 2015-12-02 00:00  
154
ClassicASP   17255  2013-02-13 21:34  
153
ClassicASP   16452  2013-02-05 11:38 ~ 2014-04-28 00:00  
152
ClassicASP   23143  2013-02-04 17:56  
열람
ClassicASP   22304  2013-02-02 14:28  
150
ClassicASP   19462  2013-02-01 20:56  
149
ClassicASP   17325  2013-01-31 02:14  
148
ClassicASP   14899  2012-11-16 21:44 ~ 2012-11-17 00:00  
147
ClassicASP   13210  2012-11-16 21:20  
146
ClassicASP   20281  2012-11-14 20:00  
145
ClassicASP   21648  2012-11-14 19:52 ~ 2016-01-26 00:00  
144
ClassicASP   16535  2012-10-23 00:30 ~ 2014-08-13 00:00  
143
ClassicASP   21191  2012-09-07 19:53  
142
ClassicASP   18005  2012-09-07 19:38  
141
ClassicASP   23687  2012-08-23 19:16 ~ 2013-12-20 00:00  
140
ClassicASP   13958  2012-06-23 23:01  
139
ClassicASP   18715  2012-06-13 13:37  

검색

해피정닷컴 정보

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

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