¾È±Ô °øºÎ¹æ

ACTIVE SERVER PAGE > ȸ¿ø °¡ÀÔ ¹Þ±â

µî·ÏÀÏ : 2017-07-03 20:08 Á¶È¸¼ö : 53,080

´Ù¸¥ ºÎºÐÀº °£´ÜÈ÷ 󸮰¡ °¡´ÉÇÒ °Å¶ó »ý°¢µÇ±¸¿ä.. Áß¿äÇÑ ºÎºÐÀÌ ¿ìÆí¹øÈ£ 󸮺κРÀä. ¿ìÆí¹øÈ£
µ¥ÀÌÅÍ º£À̽º ±¸ÃàÇÏ´Â ºÎºÐÀº ´ÙÀ½Àå¿¡¼­ Çϵµ·Ï Çϱ¸¿ä,,,,

¸ÕÀú ¿ìÆí¹øÈ£ ¹öÆ°À» ´­·¶À»¶©  onclick="open_window('ju_chk.asp')"

<script language="JavaScript">
<!--

   function open_window(url){ awindow = window.open(url,"thewindow","width=400,height=200") }

  
-->
</script>



--------------------------------------------------------------------------------
´ÙÀ½°ú °°ÀÌ ÀÚ¹Ù ½ºÅ©¸³Æ®·Î ÀÛÀº âÀ» ¿­¾î ju_chk.asp¸¦ ºÒ·¯ ¿À°Ô µË´Ï´Ù. (ju_chk.asp)È­ÀÏÀº ÁÖ¼ÒÀÇ
¸éÀ̳ª µ¿À» ÀԷ¹޴ ÆûÀÔ´Ï´Ù. ±×·±´ÙÀ½ ¼±ÅÃµÈ ÁÖ¼Ò¿Í ¿ìÆí¹øÈ£¸¦ openner °´Ã¼¸¦ »ç¿ëÇØ parent À©µµ¿ì¿¡
»Ñ·Á ÁÖ°Ô µÇ´Â °Ì´Ï´Ù. ¾Æ½Ã°Ú¾î¿ä?

±×·³, ju_chk.asp ¼Ò½ºÀÔ´Ï´Ù.


<html>
<head>
<title>ã°íÀÚ ÇÏ´Â ÁÖ¼Ò¸¦ ÀÔ·ÂÇϼ¼¿ä</title>


<script language="JavaScript">
<!-- JavaScript

function send(form)
{

  if((form.addr.value.length == 0 ) || (form.addr.value == " "))
        { alert("µ¿À̸§À» ¾²¼¼¿ä.");
          form.addr.focus(); return; }
  else
    form.submit();
}
-->
</script></head>

<body bgcolor="white" text="black" link="blue" vlink="purple" alink="red">

<p align="center"><font size="2" color="maroon"><b>µ¿À̳ª ¸éÀ» ÀÔ·Â Çϼ¼¿ä</font></p>
<form name="form" method="post" action="ju_result.asp">
<p align="center"><input type="text" name="addr" size="10"></p>
<p align="center"><input type="button" name="chk" value="ÁÖ¼Ò È®ÀÎ" onclick="send(this.form)">
<input type="button" name="close" value="´Ý±â" onclick="self.close()"></p>
</form>
<p> </p>
</body>

</html>


   À§ÀÇ ¼Ò½º¸¦ º¸¸é "ÁÖ¼ÒÈ®ÀÎ" ¹öÆ°°ú "´Ý±â" ¹öÆ°ÀÌ ÀÖ½À´Ï´Ù.  ÁÖ¼Ò ¹öÆ°À» ´­·¶À»¶© send(this.form)   
   ó·³, send ÇÔ¼ö¸¦ ºÒ·¯ ¿À°Ô µË´Ï´Ù. ±×·³, send()¿¡¼­ formÀÇ addr(name)ÀÇ °ªÀÇ ±æÀÌ°¡ 0À̰ųª   
   ºñ¾î ÀÖ´Ù¸é, on focus¸¦ ´Ù½Ã addr·Î º¸³»°Ô µË´Ï´Ù.  Á¦´ë·Î ÀÔ·ÂÀÌ µÆ´Ù¸é submit() ÇÔ¼ö¸¦ ½ÇÇà½ÃÄÑ   
   Æû¿¡ ÀÖ´Â(ju_result.asp)¸¦ ºÒ·¯ ¿À°Ô µË´Ï´Ù.

   ´ÙÀ½Àº ju_result.asp ÆÄÀÏÀÇ ³»¿ëÀ» º¸°Ú½À´Ï´Ù.    

<script language="javaScript">
<!--
function Ju_chk(form,i)
  {
var str="";
if((form.ad2.value == " ") || (form.ad2.value.length==0))
    { alert("ÁÖ¼Ò¸¦ ÀÔ·ÂÇϼ¼¿ä!");
      form.ad2.focus();
      return false;
    }
str=form.ad2.value;
opener.form.zip1.value=form.post_no[i].value.substring(0,3)
opener.form.zip2.value=form.post_no[i].value.substring(3,6);
opener.form.address.value=form.post_no[i].text+" "+str
self.close();
  }
-->
</script>
<body>

<%
  addr=request.form("addr")

  Set Conn=Server.CreateObject("ADODB.Connection")
  Conn.Open("DSN=polcomm;UID=sa;PWD=;database=sampal")
  sql="SELECT * FROM post where addr3='"&addr&"'"
  Set Result=Conn.Execute(sql)
  if Result.EOF then
%>
<center>
<font size=2><b> ¿ìÆí¹øÈ£°¡ Á¸ÀçÇÏÁö ¾Ê½À´Ï´Ù.</b><br>
<font size=2><b> Á¤È®È÷ ÀÔ·ÂÇØ ÁÖ¼¼¿ä! </b>
<hr>
<input type="button" value="µ¹¾Æ°¡±â" name="back" onclick="history.back()">
<input type="button" value="´Ý    ±â" name="close" onclick="self.close()">

<% else %>
<form name="form" method="post" action="ju_result.asp">
<center>
<font size=2><b> ³ª¸ÓÁö ÁÖ¼Ò¸¦ ÀÔ·ÂÇϼ¼¿ä </b><br><hr>
  <select name="post_no">
<% do while not Result.EOF  %>
  <% addr4=result("addr1")+" "+result("addr2")+" "+result("addr3") %>
  <option value="<%=result("post")%>"><%=addr4%>
<% Result.movenext
loop %>
</select>
<input type="text" name=ad2 size="10">
<input type="button" value="È®   ÀÎ" name="res" onclick="Ju_chk(this.form,form.post_no.selectedIndex)">
<input type="button" value="´Ý   ±â" name="close" onclick="self.close()"></form>
<% End if %>
</body>
</html>


    À§ ºÎºÐÀº ½ÇÁ¦ µ¥ÀÌÅ͵¥À̽º¿¡¼­ ÁÖ¼Ò¸¦ ºÒ·¯¿Í ¿ìÆí¹øÈ£¸¦ Ãâ·ÂÇÏ´Â ºÎºÐÀÔ´Ï´Ù.

    ÀÚ¼¼È÷ º¸¸é ju_chk.asp ÆÄÀÏ¿¡¼­ addr°ªÀÌ ³Ñ¾î¿À°Ô µÇ°ÚÁÒ??  ¸ô°Ú´Ù±¸¿ä? ±×·³ ¾ÕÀ¸·Î °¡¼Å¼­ È®    
    ÀÎÀ» ÇØ º¸½Ã±æ....  ¿©±â¿¡¼­ addr=request.form("addr") º¯¼ö¸¦ ¹Þ¾Æ¼­ addrÀ̶õ º¯¼ö¿¡ ±â¾ï ½ÃÄ×    
    ½À´Ï´Ù. ±×¸®±¸ ¹Ø¿¡ sql¹®À» º¸¸é post¶õ Å×ÀÌºí¿¡¼­ addr3°ú ³Ñ¾î¿Â º¯¼ö addrÀÇ °ªÀ» ºñ±³ÇÏ°Ô µË    
    ´Ï´Ù. ±×¸®±¸ ¹Ø¿¡ Conn.Execute(sql) sql¹®ÀåÀ» ½ÇÇàÇÏ°Ô µÇ°ÚÁÒ?

    ¾Æ·¡ÀÇ Á¶°ÇÀ» º¸¸é ( if Result.Eof then ) Result °´Ã¼ÀÇ °á°ú°¡ ³¡À̳Ä?¸¦ ¹°¾î º¸´Â °Ì´Ï´Ù.  Áï,    
    ¾î¶°ÇÑ Á¶°Çµµ ¸¸Á·ÇÏÁö ¸øÇÏ¸é µðºñ´Â °è¼ÓÇؼ­ ºñ±³Çϸ鼭 ³¡±îÁö(End of file)ºñ±³ÇÏ°ÚÁÒ? µ¥ÀÌÅ͸¦    
    ãÀ» ¶§±îÁö,,, ±×·¯´Ù ³¡À» ¸¸³ª¸é Ãâ·ÂÇØ ÁÖ¸é µÇ°ÚÁÒ?( ¿ìÆí¹øÈ£°¡ Á¸ÀçÇÏÁö ¾Ê´Â´Ù. ±×¸®±¸ ´Ù½Ã ÀÔ    
    ·ÂÇ϶õ ¸Þ½ÃÁö ±îÁö¿ä,,, ±×·¸Áö ¾ÊÀ¸¸é ( else ) µ¥ÀÌÅ͸¦ ã¾Ò´Ü ¸»ÀÌ°ÚÁÒ? °á°ú¸¦ parent À©µµ¿ì¿¡    
    »Ñ·Á ÁÖ¸é µÇ´Â °ÍÀÔ´Ï´Ù. 

    ±×·³ ÀÌÂë¿¡¼­ µðºñÀÇ ±¸Á¶¸¦ Çѹø º¸°í ³Ñ¾î °¡°Ú½À´Ï´Ù.



--------------------------------------------------------------------------------
     table name : post

    post : ¿ìÆí¹øÈ£(¿¹:110110)

    addr1: ½Ã,µµ ,, (¿¹: ¼­¿ï½Ã)

    addr2: ±¸,±º ,, (¿¹: °­³²±¸, °íⱺ,,,,)

    addr3: ¸é,µ¿,,, (¿¹: ¿ª»ïµµ, ±¸¾Ï¸®,,,,)


--------------------------------------------------------------------------------


    ±×·³, °á°ú¸¦ ÃßÃâÇß´Ù¸é ¾î¶»°Ô ÇØ¾ß ÇÒ±î¿ä,,, ¸Â½À´Ï´Ù. addr1+addr2+addr3 ÀÌ·¸°Ô ÇÏ¸é µÉ °Í    
    °°½À´Ï´Ù.     ±×¸®±¸, ¶ÇÇϳª °°Àº µ¿À̳ª °°Àº ¸éÀÌ Á¸ÀçÇÒ °æ¿ì´Â??? Àú °°Àº °æ¿ì´Â °°Àº Á¶°ÇÀÌ µÎ 
    °³ ÀÌ»ó ³ª¿Ã ¶§´Â ±âº»ÀûÀ¸·Î ÄÞº¸ ¹Ú½ºÀÇ option°ú ÅؽºÆ® °ªÀ¸·Î ³Ö¾ú½À´Ï´Ù.  ±×·³ ½±°Ô ¹®Á¦ ÇØ°á    
    µÇ°ÚÁÒ? ³ë¶õ »öÀ¸·Î µÈ  ºÎºÐÀÇ Ã³¸®°¡ ¹Ù·Î ±× ºÎºÐÀÌ´Ù.

    ±×·³ Àá½Ã ÀÚ¹Ù ½ºÅ©¸³ ºÎºÐÀ» ¼³¸íÇÏ°í ³Ñ¾î°¡ º¸°í ½Í±º¿ä.

    ¸ÕÀú ¼Ò½º¿¡ ÀÖ´Â form.post_no[i].value °ªÀº ¿©·¯ ÄÞº¸¹Ú½ºÀÇ °ª Áß ¼±ÅÃµÈ °ª (result("post")¸¦    
    ³ªÅ¸³»°í form.post_no[i].text °ªÀº optionÀÇ ÅؽºÆ®ÀÇ °ªÀÔ´Ï´Ù. (rusult("addr4"))

    ¿©±â¿¡¼­ ³Ñ¾î°¡´Â iÀÇ °ªÀº form.post_no.selectedIndex (form°´Ã¼ post_noÀÇ index °ªÀÔ´Ï´Ù. )

    À§¿¡¼­ ³Ñ¾î¿Â À妽º °ªÀ» i¶ó´Â º¯¼ö·Î ¹Þ¾Æ ó¸®ÇÑ °ÍÀÔ´Ï´Ù. ±×·³, ÇöÀç ¿ìÆí¹øÈ£´Â (110110)À»    
    ´ÙÀ½°ú °°ÀÌ (110-110)À¸·Î ³Ö¾î¾ß Çϱ⠶§¹®¿¡ °ªÀ» ³ª´²¾ß ÇÕ´Ï´Ù.

    ÀÚ¹Ù ½ºÅ©¸³Æ®¿¡¼­ °ªÀ» ³ª´©´Â ÇÔ¼ö´Â substring(0,3)ÀÔ´Ï´Ù. óÀ½ºÎÅÍ 3¹ø° ¹®ÀÚ±îÁö °ªÀ» ÃëÇÏ°Ô µÇ´Â
    °ÍÀÔ´Ï´Ù. ÀÌÂëÀ̸é ÀÌÇØ°¡ °¡½Ç·Á³ª ¸ð¸£°Ú³×¿ä... Àúµµ Àü¹®ÀûÀ¸·Î °øºÎÇÏÁö ¸øÇؼ­,, ÀÌÇظ¦ ¸øÇϼ̴ٸé,
    , Á˼Û,,   Âü, ±×¸®±¸, ºÎ¸ð À©µµ¿ì·Î °ªÀ» ³Ñ±æ¶© openner °´Ã¼¸¦ »ç¿ëÇϴ°Š¾Æ½ÃÁÒ,, ???
¡Ø Ȥ½Ã µµ¿òÀÌ µÇ¼Ì´Ù¸é ´ñ±Û¿¡ ÇѸ¶µð ³²°ÜÁÖ¼¼¿ä!
ÀÛ¼ºÀÚ   ºñ¹Ð¹øÈ£
ÀÚµ¿±Û ¹æÁö     (ÀÚµ¿±Û ¹æÁö ±â´ÉÀÔ´Ï´Ù.)
³»¿ë   ´ñ±Û´Þ±â 
À̸ÞÀÏ ¹®ÀÇ : cak0280@nate.com  
Copyright 2000 By ENTERSOFT.KR All Rights Reserved.