0
 33   4   1
  View Articles

Name  
   ¼Õº´¸ñ  (2002-11-24 02:07:05, Hit : 34452, Vote : 2735)
Homepage  
   http://www.itmembers.net
Subject  
   °Ô½ÃÆÇ ±Û ³»¿ë º¸±â ±â´É(2) view.php ¼Ò½º

Áö³­ ½Ã°£¿¡ ¸¸µç HTML ¼Ò½º¿¡ ÇÁ·Î±×·¥À» ÀÔÇû½À´Ï´Ù.

¼³¸íÀº ´ÙÀ½ ½Ã°£¿¡ Çϴµ¥, ¾Æ·¡ ÆĶõ »ö ºÎºÐÀ» Áß½ÉÀ¸·Î ¼³¸íÇÕ´Ï´Ù.
ÀÌÀü ½Ç½À ³»¿ëÀ» ÀÌÇØÇϼ̴ٸé, ¾Æ·¡ ÆĶõ »ö ºÎºÐ¸¸ ÁÖÀDZí°Ô º¸½Ã¸é µÉ °Ì´Ï´Ù.


  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. $query = "update $tablename set count = count + 1 where number='$number'";
  26. mysql_query($query);
  27.  
  28. ?>
  29.  
  30. <html>
  31. <head>
  32. <title>PHP °Ô½ÃÆÇ ÇÁ·ÎÁ§Æ® - º¸±â</title>
  33. <STYLE TYPE="text/css">
  34. BODY,TD,SELECT,input,DIV,form,TEXTAREA,center,option,pre,blockquote {font-family:±¼¸²;font-size:9pt;color:#555555;}
  35. A:link    {color:black;text-decoration:none;}
  36. A:visited {color:black;text-decoration:none;}
  37. A:active  {color:black;text-decoration:none;}
  38. A:hover  {color:gray;text-decoration:none;}
  39. </STYLE>
  40. </head>
  41. <body bgcolor=white background=./images/body_bg.gif>
  42. <img src=./images/maintitle.gif>
  43. <table border=0 cellspacing=1 cellpadding="3" width=670>
  44.         <tr>
  45.           <td align=center>
  46.           <font color=green><b>³»¿ë º¸±â È­¸éÀÔ´Ï´Ù.</b></font>
  47.           </td>
  48.         </tr>
  49.     <tr>
  50.           <td bgcolor="#EAC3EA">
  51. <table border=0 cellspacing=1 cellpadding=0 width=670 bgcolor="white">
  52.         <tr>
  53.           <td width="100">
  54.             <p align="right"><b>À̸§ &nbsp;</b></p>
  55.  
  56.           </td>
  57.           <td width="400">
  58.                         <p><? echo $array[name]; ?></p>
  59.           </td>
  60.           <td width="100">
  61.                         <p align="right"><b>Á¶È¸¼ö &nbsp;</b></p>
  62.           </td>
  63.           <td>
  64.                         <p><? echo $array[count]; ?></p>
  65.           </td>
  66.         </tr>
  67.                 <tr>
  68.           <td width="100">
  69.                         <p align="right"><b>ÀüÀÚ¿ìÆí &nbsp;</b></p>
  70.           </td>
  71.           <td colspan="3">
  72.                         <p><? echo $array[email]; ?></p>
  73.           </td>
  74.                 </tr>
  75.                 <tr>
  76.           <td width="100">
  77.                         <p align="right"><b>ȨÆäÀÌÁö &nbsp;</b></p>
  78.           </td>
  79.           <td colspan="3">
  80.                         <p><? echo $array[homepage]; ?></p>
  81.           </td>
  82.                 </tr>
  83.                 <tr>
  84.           <td width="100">
  85.                         <p align="right"><b>Á¦¸ñ &nbsp;</b></p>
  86.           </td>
  87.           <td colspan="3">
  88.                         <p><? echo $array[subject]; ?></p>
  89.           </td>
  90.                 </tr>
  91.         <tr>
  92.           <td width="100">
  93.                         <p align="right"><b>³»¿ë &nbsp;</b></p>
  94.           </td>
  95.           <td colspan="3">
  96.                         <p><? echo $array[memo]; ?></p>
  97.           </td>
  98.         </tr>
  99. </table>
  100.             <p align="center"><a href="list.php?page=<? echo $page; ?>">[¸ñ·Ï]</a> &nbsp;<a href="write.php">[¾²±â]</a> &nbsp;<a href="modify.php?number=<? echo $number; ?>&page=<? echo $page; ?>">[¼öÁ¤]</a> &nbsp;<a href="delete.php?number=<? echo $number; ?>&page=<? echo $page; ?>">[»èÁ¦]</a></p>
  101.           </td>
  102.     </tr>
  103. </table>
  104. </body>
  105. </html>

ÀÌ»ó, µ¿Á־ƺü ¼Õº´¸ñÀ̾ú½À´Ï´Ù.


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

¼Õº´¸ñ
Next
   °Ô½ÃÆÇ ±Û ³»¿ë º¸±â ±â´É(1) view.php µðÀÚÀÎ

¼Õº´¸ñ


Copyright 1999-2024 Zeroboard / skin by Zetyx