0
 33   4   1
  View Articles

Name  
   ¼Õº´¸ñ  (2002-12-01 01:20:18, Hit : 46282, Vote : 2868)
Homepage  
   http://www.itmembers.net
Subject  
   °Ô½ÃÆÇ ±Û ³»¿ë ¼öÁ¤ ±â´É(1) modify.php ¼Ò½º

À̹ø ½Ã°£ºÎÅÍ´Â ±Û ³»¿ë ¼öÁ¤, »èÁ¦¿¡ ´ëÇØ ´Ù·ç°Ú½À´Ï´Ù.
¸ÕÀú 4½Ã°£¿¡ °ÉÃÄ ¾Æ·¡ 4°³ÀÇ ÆÄÀÏ ¼Ò½ººÎÅÍ °ø°³ÇÏ°Ú½À´Ï´Ù.

ÆÄÀϸí

±â´É

modify.php

±Û ¼öÁ¤ Æû

modify_ok.php

±Û ¼öÁ¤ DB ó¸® ºÎºÐ

delete.php

±Û »èÁ¦ Æû

delete_ok.php

±Û »èÁ¦ DB ó¸® ºÎºÐ

modify.php´Â ±Û ³»¿ë º¸±â¿¡¼­ [¼öÁ¤]À» ¼±ÅÃÇßÀ» ¶§ ÀÛµ¿ÇÏ´Â ±Û ¼öÁ¤ ±â´ÉÀÔ´Ï´Ù.
±âº»ÀûÀ¸·Î ÇüÅ´ ±Û ÀÔ·Â Æû°ú °ÅÀÇ À¯»çÇÏ°í,
PHP ÇÁ·Î±×·¥ ºÎºÐÀº ±Û ³»¿ë º¸±â ±â´É°ú °ÅÀÇ À¯»çÇÕ´Ï´Ù.
ÀÌ¹Ì ¾Õ¿¡¼­ ´Ù »ìÆì º¸¾Ò´ø °ÍÀ̴ϸ¸Å­ ºñ±³Àû ½±°Ô ÀÌÇØ°¡ µÉ °ÍÀÔ´Ï´Ù.

¿ì¼± ¼Ò½º¸¦ ÁÖ~¿í »ìÆì º¸½Ã±â ¹Ù¶ø´Ï´Ù.


  1. <?
  2. //DB¿¡ ¿¬°áÇÏ´Â ºÎºÐÀÔ´Ï´Ù. Ç×»ó ¹Ýº¹µÇ´Â ºÎºÐÀÌ´Ï ²À ¾Ï±â!!!
  3. mysql_connect("localhost", "phpbbs", "phpbbs") or die (mysql_error());
  4. mysql_select_db("itmembers");
  5.  
  6. //º¯¼ö ¼³Á¤ÇÕ´Ï´Ù.
  7. $tablename="bbs"; //Å×À̺í À̸§
  8.  
  9. //Å×ÀÌºí¿¡¼­ ±ÛÀ» °¡Á®¿É´Ï´Ù.
  10. $query = "select * from $tablename where number='$number'"; // ±Û ¹øÈ£¸¦ °¡Áö°í Á¶È¸¸¦ ÇÕ´Ï´Ù.
  11. $result = mysql_query($query) or die (mysql_error());
  12. $array = mysql_fetch_array($result);
  13.  
  14. //¹é½½·¡½¬ Á¦°Å, Ư¼ö¹®ÀÚ º¯È¯(HTML¿ë), °³Çà(<br>)ó¸® µî
  15. $array[name] = stripslashes($array[name]);
  16. $array[subject] = stripslashes($array[subject]);
  17. $array[memo] = stripslashes($array[memo]);
  18.  
  19. //$array[subject] = htmlspecialchars($array[subject]);
  20. //$array[memo] = htmlspecialchars($array[memo]);
  21.  
  22. //$array[memo] = nl2br($array[memo]);
  23.  
  24. ?>
  25.  
  26. <html>
  27. <head>
  28. <title>PHP °Ô½ÃÆÇ ÇÁ·ÎÁ§Æ® - ¼öÁ¤</title>
  29.  
  30. <STYLE TYPE="text/css">
  31. BODY,TD,SELECT,input,DIV,form,TEXTAREA,center,option,pre,blockquote {font-family:±¼¸²;font-size:9pt;color:#555555;}
  32. A:link    {color:black;text-decoration:none;}
  33. A:visited {color:black;text-decoration:none;}
  34. A:active  {color:black;text-decoration:none;}
  35. A:hover  {color:gray;text-decoration:none;}
  36. </STYLE>
  37.  
  38.  
  39. <script language="javascript">
  40.  
  41. function check_submit() {
  42.         
  43.         if (document.myForm.name.value == "") {
  44.                 alert('À̸§À» ÀÔ·ÂÇϼ¼¿ä');
  45.                 document.myForm.name.focus();
  46.                 return;
  47.                 
  48.         } else if (document.myForm.password.value == "") {
  49.                 alert('ºñ¹Ð¹øÈ£¸¦ ÀÔ·ÂÇØ¾ß ±ÛÀ» ¼öÁ¤Çϰųª »èÁ¦ÇÒ ¼ö ÀÖ½À´Ï´Ù.');
  50.                 document.myForm.password.focus();
  51.                 return;
  52.                 
  53.         } else if (document.myForm.subject.value == "") {
  54.                 alert('Á¦¸ñÀ» ÀÔ·ÂÇϼ¼¿ä');
  55.                 document.myForm.subject.focus();
  56.                 return;
  57.                 
  58.         } else if (document.myForm.memo.value == "") {
  59.                 alert('³»¿ëÀ» ÀÔ·ÂÇϼ¼¿ä');
  60.                 document.myForm.memo.focus();
  61.                 return;
  62.                 
  63.         } else {
  64.                 document.myForm.action = "modify_ok.php";
  65.                 document.myForm.submit();
  66.         }
  67.         
  68. }
  69.  
  70. </script>
  71.  
  72. </head>
  73.  
  74. <body bgcolor=white background=./images/body_bg.gif>
  75.  
  76. <img src=./images/maintitle.gif>
  77.  
  78. <br>
  79.  
  80. <form name='myForm' method='post' >
  81.  
  82. <input type=hidden name=page value='<? echo $page; ?>'>
  83. <input type=hidden name=number value='<? echo $number; ?>'>
  84.  
  85. <table border=0 cellspacing=1 cellpadding=0 width=670>
  86.         <tr>
  87.           <td align=center>
  88.           <font color=green><b>±Û ¼öÁ¤ È­¸éÀÔ´Ï´Ù.</b></font>
  89.           </td>
  90.         </tr>
  91. </table>
  92.  
  93. <table border=0 bgcolor=#CCCCF><tr><td>
  94.  
  95. <table border=0 width=670 cellspacing=0 cellpadding=0 bgcolor=#F0F0F0>
  96.  
  97.         <col width=100></col><col width=></col>
  98.  
  99.         <tr>
  100.         <td colspan=2>
  101.              <table border=0 cellspacing=0 cellpadding=0 width=100%>
  102.                  <tr>
  103.                   <td width=100 align=right><b>À̸§&nbsp;</b></td>
  104.                 <td><input type=text name=name size=20  maxlength=20 value= '<? echo $array[name]; ?>'></td>                    
  105.                   <td width=100 align=right><b>ºñ¹Ð¹øÈ£&nbsp;</b></td>
  106.                 <td><input type=password name=password  size=20  maxlength=20 value=''></td>
  107.                  </tr>
  108.                         </table>
  109.           </td>
  110.         </tr>
  111.  
  112.         <tr><td bgcolor=white height=1 colspan=2></td></tr>
  113.         
  114.         <tr>
  115.           <td align=right><b>ÀüÀÚ¿ìÆí&nbsp;</b></td>
  116.           <td> <input type=text name=email size=40  maxlength=200 value='<? echo $array[email]; ?>'> </td>
  117.         </tr>
  118.         
  119.         <tr><td bgcolor=white height=1 colspan=2></td></tr>
  120.  
  121.         <tr>
  122.           <td align=right><b>ȨÆäÀÌÁö&nbsp;</b></td>
  123.           <td> <input type=text name=homepage size=40  maxlength=200 value='<? echo $array[homepage]; ?>'> </td>
  124.         </tr>
  125.  
  126.         <tr><td bgcolor=white height=1 colspan=2></td></tr>
  127.  
  128.         <tr>
  129.           <td align=right><b>Á¦¸ñ&nbsp;</b></td>
  130.           <td> <input type=text name=subject size=87  maxlength=200 value='<? echo $array[subject]; ?>'> </td>
  131.         </tr>
  132.  
  133.         <tr><td bgcolor=white height=1 colspan=2></td></tr>
  134.  
  135.         <tr>
  136.           <td align=right><b>³»¿ë&nbsp;</b></td>
  137.           <td valign=top>
  138.           <textarea name=memo cols=85 rows=20> <? echo $array[memo]; ?> </textarea>
  139.           </td>
  140.         </tr>
  141.  
  142. </table>
  143.  
  144. <br>
  145.  
  146. <table border=0 width=670>
  147. <tr><td>
  148. <center>
  149. <a href="javascript:check_submit();"><img src='./images/write.gif' border=0></a> &nbsp;&nbsp;
  150. <a href="list.php?page=<? echo $page ;  ?>"><img src=./images/list.gif border=0></a>
  151. </center>
  152. </td></tr>
  153. </table>
  154. </td></tr></table>
  155.  
  156. </form>
  157.  
  158. </body>
  159. </html>

Prev
   °Ô½ÃÆÇ ±Û ³»¿ë ¼öÁ¤ ±â´É(2) modify_ok.php ¼Ò½º

¼Õº´¸ñ
Next
   °Ô½ÃÆÇ ±Û ³»¿ë º¸±â ±â´É(3) view.php ¼³¸í

¼Õº´¸ñ


no
subject
name
date
hit
*
Copyright 1999-2024 Zeroboard / skin by Zetyx