묻고답하기

asp 질문입니당;;

2003.02.10 00:25

김소정


게시판을 한개 짜고 다른 기능들은 구현이 다 되었는데 수정이 제대로 안되네요..ㅜ_ㅜ

-----modipy.asp---------------------------------------------------------------------------------

<!-- #include file = "../inc/dbcon.inc" -->
<%
     id=request("id")
     pass=request("pass")

     set rs=server.createobject("adodb.recordset")      
     rs.open "select f_pwd from board_free where f_id="&id,dbcon,1,2

     if pass <> rs("f_pwd")  then
%>


<script language="javascript">
<!--
alert("비밀번호가 일치하지 않습니다.")
history.back()
-->
</script>  

<%else
     set rs=server.createobject("adodb.recordset")
     rs.open "select * from board_free where f_id="&id,dbcon,1,2
%>
<html>
<head>
<title>서울산업대학교 환경공학과 동문회</title>
<meta http-equiv="Content-Type" content="text/html; charset=euc-kr">
<script language="JavaScript">
<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>

<script language="JavaScript">
<!--
    function sendit()
    {      
        if(myform.name.value=="")
         {
           alert("이름을 입력해 주세요..")
           myform.name.focus()
           return
         }
        
         if(myform.subject.value=="")
         {
           alert("제목을 입력해 주세요..")
           myform.subject.focus()
           return
         }
        
         if(myform.content.value=="")
         {
           alert("내용을 입력해 주세요..")
           myform.content.focus()
           return
         }
        
         if(myform.pwd.value=="")
         {
           alert("암호를 입력해 주세요..n수정/삭제시 필요합니다..")
           myform.pwd.focus()
           return
         }
         myform.submit()
     }  
//-->
</script>

<link rel="stylesheet" href="../css/text.css" type="text/css">
</head>

<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onLoad="MM_preloadImages('images/m_l_m_02_2.gif','images/m_l_m_03_3.gif','images/m_m_01_1.gif','images/m_m_02_1.gif','images/m_m_03_1.gif','images/m_m_04_1.gif','images/m_m_05_1.gif','images/sub_menu_r_02.gif')">
<table width="851" border="0" cellspacing="0" cellpadding="0" height="100%">
  <tr>
    <td height="37" colspan="2">
      <table width=851 border=0 cellpadding=0 cellspacing=0 height="37">
        <tr>
          <td><img src="images/top_logo.gif" width=260 height=37></td>
          <td width="297"> </td>
          <td><img src="images/top_m_01.gif" width="52" height="37"></td>
          <td><img src="images/top_m_02.gif" width="51" height="37"></td>
          <td><img src="images/top_m_03.gif" width="66" height="37"></td>
          <td><img src="images/top_m_04.gif" width="69" height="37"></td>
          <td><img src="images/top_m_05.gif" width="63" height="37"></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td height="5" colspan="2">
      <table width="851" height="5" border="0" cellspacing="0" cellpadding="0" >
        <tr>
          <td width="543"></td>
          <td bgcolor="#555555" width="308" height="5"></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td height="35" colspan="2">
      <table width="851"  height="35" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="543">
            <table border=0 cellpadding=0 cellspacing=0>
              <tr>
                <td width="93"><img src="images/m_blank.gif" width=93 height=35></td>
                <td width="96"><a href="#" onFocus="this.blur()"onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image321','','images/m_m_01_1.gif',1)"><img name="Image321" border="0" src="images/m_m_01.gif" width="96" height="35"></a></td>
                <td width="98"><a href="#" onFocus="this.blur()"onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image331','','images/m_m_02_1.gif',1)"><img name="Image331" border="0" src="images/m_m_02.gif" width="98" height="35"></a></td>
                <td width="110"><a href="#" onFocus="this.blur()"onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image341','','images/m_m_03_1.gif',1)"><img name="Image341" border="0" src="images/m_m_03.gif" width="110" height="35"></a></td>
                <td width="71"><a href="#" onFocus="this.blur()"onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image351','','images/m_m_04_1.gif',1)"><img name="Image351" border="0" src="images/m_m_04.gif" width="71" height="35"></a></td>
                <td width="75"><a href="#" onFocus="this.blur()"onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image361','','images/m_m_05_1.gif',1)"><img name="Image361" border="0" src="images/m_m_05.gif" width="75" height="35"></a></td>
              </tr>
            </table>
          </td>
          <td width="308">
            <table width="308" border="0" cellspacing="0" cellpadding="0" height="35">
              <tr>
                <td width="67"><img src="images/search_t.gif" width=67 height=35></td>
                <td width="78" bgcolor="#555555"><input type="text" name="textfield" size="9"></td>
                <td width="55"><input type="image" border="0" name="imageField" src="images/search_i.gif" width="55" height="35"></td>
                <td width="108"><input type="image" border="0" name="imageField2" src="images/search_ii.gif" width="108" height="35"></td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td bgcolor="#FFFFFF" height="1" colspan="2"></td>
  </tr>
  <tr>
    <td height="130" colspan="2">
      <table width="851" border="0" cellspacing="0" cellpadding="0" height="130">
        <tr>
          <td width="191" background="images/main_img_01.gif" valign="top"><object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="191" height="98">
              <param name=movie value="../swf/m_5.swf">
              <param name=quality value=high>
              <param name="wmode" value="transparent">
              <embed src="../swf/m_5.swf" quality=high pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="191" height="98" wmode="transparent">
              </embed>
            </object></td>
          <td width="660"><img src="images/main_img_02.jpg" width="660" height="130"></td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td valign="top" width="191" background="images/m_l_bg.gif">
      <table width="191" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td><a href="index.asp"><img src="images/sub_menu_r_01.gif" width="191" height="41" border="0"></a></td>
        </tr>
        <tr>
          <td><a href="../board_qna/index.asp" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Image30','','images/sub_menu_r_02.gif',1)"><img name="Image30" border="0" src="images/sub_menu_02.gif" width="191" height="34"></a></td>
        </tr>
      </table>
    </td>
    <td valign="top" width="660" background="images/m_r_bg.gif">
      <table width="660" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="25"> </td>
          <td width="610"> </td>
          <td width="25"> </td>
        </tr>
        <tr>
          <td width="25"> </td>
          <td width="610"><img src="images/b_sub_t_01.gif" width="150" height="30">
            <table width="100%" border="0" cellspacing="0" cellpadding="0" height="2">
              <tr>
                <td width="25%" bgcolor="999999"></td>
                <td width="75%" bgcolor="cccccc"></td>
              </tr>
            </table>
          </td>
          <td width="25"> </td>
        </tr>
        <tr>
          <td width="25"> </td>
          <td width="610">  </td>
          <td width="25"> </td>
        </tr>
        <tr>
          <td width="25"> </td>
          <td width="610" align="center">
            <table width="95%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td>
                  <form name=myform method=post action=modify_ok.asp>
                    <table width="100%" border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td>
                          <table width="100%" border="0" cellspacing="2" cellpadding="0">
                            <tr bgcolor="#DEDEDE">
                              <td colspan="4" height="1"></td>
                            </tr>
                            <tr>
                              <td  width=97 bgcolor=F7F9FC height=30 align="center">
                                <font color="#000000"> 글 제 목 </font></td>
                              <td height="25" colspan="3">   
                                <input class=input style="BORDER-RIGHT: #999999 1px solid; BORDER-TOP: #999999 1px solid;
                                                                FONT-SIZE: 9pt; BORDER-LEFT: #999999 1px solid; BORDER-BOTTOM: #999999 1px solid; HEIGHT: 18px; BACKGROUND-COLOR: #ffffff"
                             name=subject size="73" value="<%=rs("f_subject")%>">
                              </td>
                            </tr>
                            <tr bgcolor="#DEDEDE">
                              <td colspan="4" height=1> </td>
                            </tr>
                            <tr>
                              <td  width=97 bgcolor=F7F9FC height=30 align="center">
                                <font color="#000000"> 작 성 자</font></td>
                              <td width="173" height="25">   
                                <input class=input style="BORDER-RIGHT: #999999 1px solid; BORDER-TOP: #999999 1px solid;
                                                                FONT-SIZE: 9pt; BORDER-LEFT: #999999 1px solid; BORDER-BOTTOM: #999999 1px solid; HEIGHT: 18px; BACKGROUND-COLOR: #ffffff"
                             name=name size="20" value="<%=rs("f_name")%>">
                              </td>
                              <td  width=96 bgcolor=F7F9FC height=30 align="center">
                                <font color="#000000"> E-MAIL</font></td>
                              <td width="204" height="25">  
                                <input class=input style="BORDER-RIGHT: #999999 1px solid; BORDER-TOP: #999999 1px solid;
                                                                FONT-SIZE: 9pt; BORDER-LEFT: #999999 1px solid; BORDER-BOTTOM: #999999 1px solid; HEIGHT: 18px; BACKGROUND-COLOR: #ffffff"
                             name=email size="28" value="<%=rs("f_email")%>">
                              </td>
                            </tr>
                            <tr bgcolor="#DEDEDE">
                              <td colspan="4" height=1> </td>
                            </tr>
                            <tr bgcolor="EAF0F8">
                              <td colspan="4" height=25 align="center"> <font color="#000000">내    용
                                </font> </td>
                            </tr>
                            <tr>
                              <td colspan="4" height=1 bgcolor="eeeeee"> </td>
                            </tr>
                            <tr>
                              <td height="240" colspan="4" align="center"> <font color="#000000">
                                </font>
                                <textarea class=textarea

                  style="BORDER-RIGHT: #999999 1px solid; BORDER-TOP: #999999 1px solid; FONT-SIZE: 9pt; BORDER-LEFT: #999999 1px solid; BORDER-BOTTOM: #999999 1px solid; BACKGROUND-COLOR: #ffffff"

                  name="content" cols="90" rows="15"><%=rs("f_content")%></textarea>
                              </td>
                            </tr>
                            <tr bgcolor="#DEDEDE">
                              <td colspan="4" height="1"></td>
                            </tr>
                            <tr>
                              <td  width=97 bgcolor=F7F9FC height=30 align="center">
                                <font color="#000000"> 비밀번호</font></td>
                              <td height="25" colspan="3">   
                                <input class=input style="BORDER-RIGHT: #999999 1px solid; BORDER-TOP: #999999 1px solid;
                                                                FONT-SIZE: 9pt; BORDER-LEFT: #999999 1px solid; BORDER-BOTTOM: #999999 1px solid; HEIGHT: 18px; BACKGROUND-COLOR: #ffffff"
                             name=pwd size="20" value="<%=rs("f_pwd")%>">
                              </td>
                            </tr>
                            <tr bgcolor="#DEDEDE">
                              <td colspan="4" height="1"></td>
                            </tr>
                            <tr>
                              <td colspan="4" height="8"></td>
                            </tr>
                          </table>
                          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td width=210 height="28">  </td>
                              <input type=hidden name="id"  value="<%=request("id")%>">
                              <td width=80 align="center"> <a href="javascript:sendit()"><img src="images/i_send.gif" width="47" height="19" border="0"></a></td>
                              <td width=70 align="center"> <a href="javascript:history.back();"><img src="images/i_cancel.gif" width="47" height="19" border="0"></a></td>
                              <td width=210> </td>
                            </tr>
                          </table>
                        </td>
                      </tr>
                    </table>

                  </form>
                </td>
              </tr>
            </table>
          </td>
          <td width="25"> </td>
        </tr>
      </table>
    </td>
  </tr>
  <tr>
    <td height="83" colspan="2">
      <table width="851" border="0" cellspacing="0" cellpadding="0" height="83">
        <tr>
          <td rowspan="3" width="194" height="83"><img src="images/copy_logo.gif" width="194" height="83"></td>
          <td height="35" width="657">
            <table width=657 border=0 cellpadding=0 cellspacing=0>
              <tr>
                <td><a href="#" onfocus="this.blur()"><img src="images/copy_m_01.gif" width=72 height=35 border="0"></a></td>
                <td><a href="#" onfocus="this.blur()"><img src="images/copy_m_02.gif" width=73 height=35 border="0"></a></td>
                <td><a href="#" onfocus="this.blur()"><img src="images/copy_m_03.gif" width=83 height=35 border="0"></a></td>
                <td><a href="#" onfocus="this.blur()" ><img src="images/copy_m_04.gif" width=53 height=35 border="0"></a></td>
                <td><a href="#" onfocus="this.blur()"><img src="images/copy_m_05.gif" width=53 height=35 border="0"></a></td>
                <td><a href="#" onfocus="this.blur()"><img src="images/copy_m_06.gif" width=63 height=35 border="0"></a></td>
                <td><a href="#" onfocus="this.blur()"><img src="images/copy_m_07.gif" width=81 height=35 border="0"></a></td>
                <td><img src="images/copy_m_08.gif" width=179 height=35></td>
              </tr>
            </table>
          </td>
        </tr>
        <tr>
          <td><img src="images/copy2.gif" width="657" height="17"></td>
        </tr>
        <tr>
          <td height="31">
            <table width="657" border="0" cellspacing="0" cellpadding="0" height="31">
              <tr>
                <td width="581"><img src="images/copy1.gif" width="581" height="31"></td>
                <td width="76"><a href="admin.html" onfocus="this.blur()" target="_blank"><img src="images/admin.gif" width="76" height="31" border="0"></a></td>
              </tr>
            </table>
          </td>
        </tr>
      </table>
    </td>
  </tr>
</table>
</body>
</html>
<%
rs.close
dbcon.close
set rs=nothing
set dbcon=nothing
%>    

<%end if%>



------------modify_ok.asp---------------------------------------------------------------------

<!-- #include file = "../inc/dbcon.inc" -->
<%
    id=request("id")

    name=request("name")
    email=request("email")
    subject=request("subject")
    content=request("content")

      name=replace(name,"'","''")
      subject=replace(subject,"'","''")
      content=replace(content,"'","''")
    
      subject=replace(subject,"&","&")
      subject=replace(subject,"<","<")
      subject=replace(subject,">",">")
      content=replace(content,"&","&")
      content=replace(content,"<","<")
      content=replace(content,">",">")
    

sql="update board_free set f_name='"&name&"',f_email='"&email&"',f_subject='"&subject&"',f_content='"&content&"' where f_id="&id
    
   db.execute sql

  dbcon.close
  set dbcon=nothing
%>

<script language="javascript">        
<!--
alert("글을 성공적으로 수정하였습니다.")
location.href="index.asp"
-->
</script>




같은 sql 명령을 쿼리분석기에서 직접 입력해보면 실행이 되는데,
뭐가 잘못된건지 알수가 없네요..ㅠ_ㅠ
작성한 게시판의 주소는 http://www.yearning.pe.kr/test/board_free/index.asp 입니다.
답변 부탁드립니다...





글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
+프렌+ 도대체 이들이 쓰는 기본 폰트는 무엇?? [3] file 2007.08.10
이경록 db연동이 무엇인지...... [1] 2007.08.10
서진 플래쉬 액션 질문요....  
손선미 일본어를 보고싶은데 글자가 깨져서 나와요 [3] 2007.08.10
허준 네임서버 설정법에 관한 질문 입니다. (윈도우즈) [1] 2007.08.10
까꿍이 웹폰트 질문입니다 [3] 2007.08.10
박봉수 html 파일을 제로보드 게시판 안에서 뛰울수 없나요? [1] 2007.08.10
한일도 history.go(-1)에 대한 질문... [2] 2007.08.10
변향연 클릭하면팝업창을띄우려고하는데요..ㅡㅜ [1] 2007.08.10
junic 도메인중[xx.com/~junic] "~"삭제 어캐해여  
미자 세션의 수명지정에 대해서.. [3] 2007.08.10
하정선 게시판을 열면 이상한 말들이...ㅡㅡ;; [1] 2007.08.10
송주희 로그인이 자꾸 움직이는데 고정하는 법 이 없나요? [3] 2007.08.10
린아 테이블태그 질문. [4] 2007.08.10
김소정 asp 질문입니당;; [4] 2007.08.10
Xeon [질 문] 새창에서 열기 에 관하여  
김형태 제로보드에서 회원가입을 하고 테크노트에 자동 회원가입  
이용일 PWS에서 PHP설치 하는데 다음 과 같은 에러가 나요.  
Xeon PHP 스킨을 관련 질문 [3] 2007.08.10
정재화 아이프레임에서요... [1] 2007.08.10
HiKaRi 이미지 업로드가 안되요.  
☺zylon 플래시에서 변수인식이 안되염  
은종 프레임두개있을때 한쪽에서 리프래쉬 하면 둘다되나요? [1] 2007.08.10
김지혜 도저히 알 수 가 없어요ㅜ_- [3] 2007.08.10
레드 IFRAME을 드래그해서 크롬리스처럼 사용하기  
Huya 나모에서 홈페이지 만들떼요.. [3] 2007.08.10
☺zylon 변수를 쪼갤수 있나요? [3] 2007.08.10
whitefox c언어냐 php냐 [3] 2007.08.10
taeho 플레쉬 강의가 있는 어디 추천해줄만한 곳이 있나요? [1] 2007.08.10
울산사람 비비샵을 설치했는데 첫화면이 작게나와요