|
|
|
|
|
0 |
|
View Articles |
|
|
Name |
¼Õº´¸ñ |
(2002-11-24 02:07:05, Hit : 34452, Vote : 2735)
|
|
|
Homepage |
http://www.itmembers.net |
|
Subject |
°Ô½ÃÆÇ ±Û ³»¿ë º¸±â ±â´É(2) view.php ¼Ò½º |
|
|
Áö³ ½Ã°£¿¡ ¸¸µç HTML ¼Ò½º¿¡ ÇÁ·Î±×·¥À» ÀÔÇû½À´Ï´Ù.
¼³¸íÀº ´ÙÀ½ ½Ã°£¿¡ Çϴµ¥, ¾Æ·¡ ÆĶõ »ö ºÎºÐÀ» Áß½ÉÀ¸·Î ¼³¸íÇÕ´Ï´Ù. ÀÌÀü
½Ç½À ³»¿ëÀ» ÀÌÇØÇϼ̴ٸé, ¾Æ·¡ ÆĶõ »ö ºÎºÐ¸¸ ÁÖÀDZí°Ô º¸½Ã¸é µÉ °Ì´Ï´Ù.
- <?
- //DB¿¡ ¿¬°áÇÏ´Â ºÎºÐÀÔ´Ï´Ù. Ç×»ó ¹Ýº¹µÇ´Â ºÎºÐÀÌ´Ï ²À ¾Ï±â!!!
- mysql_connect("localhost", "phpbbs", "phpbbs")
or die (mysql_error());
- mysql_select_db("itmembers");
-
- //º¯¼ö ¼³Á¤ÇÕ´Ï´Ù.
- $tablename="bbs"; //Å×À̺í À̸§
-
- //Å×ÀÌºí¿¡¼ ±ÛÀ» °¡Á®¿É´Ï´Ù.
- $query = "select * from $tablename where number='$number'";
// ±Û ¹øÈ£¸¦ °¡Áö°í Á¶È¸¸¦ ÇÕ´Ï´Ù.
- $result = mysql_query($query) or die (mysql_error());
- $array = mysql_fetch_array($result);
-
- //¹é½½·¡½¬ Á¦°Å, Ư¼ö¹®ÀÚ º¯È¯(HTML¿ë), °³Çà(<br>)ó¸® µî
- $array[name] = stripslashes($array[name]);
- $array[subject] = stripslashes($array[subject]);
- $array[memo] = stripslashes($array[memo]);
-
- $array[subject] = htmlspecialchars($array[subject]);
- $array[memo] = htmlspecialchars($array[memo]);
-
- $array[memo] = nl2br($array[memo]);
-
- // Á¶È¸¼ö Ä«¿îÅÍ Áõ°¡
- $query = "update $tablename set count = count + 1 where number='$number'";
- mysql_query($query);
-
- ?>
-
- <html>
- <head>
- <title>PHP °Ô½ÃÆÇ ÇÁ·ÎÁ§Æ® - º¸±â</title>
- <STYLE TYPE="text/css">
- BODY,TD,SELECT,input,DIV,form,TEXTAREA,center,option,pre,blockquote
{font-family:±¼¸²;font-size:9pt;color:#555555;}
- A:link {color:black;text-decoration:none;}
- A:visited {color:black;text-decoration:none;}
- A:active {color:black;text-decoration:none;}
- A:hover {color:gray;text-decoration:none;}
- </STYLE>
- </head>
- <body bgcolor=white background=./images/body_bg.gif>
- <img src=./images/maintitle.gif>
- <table border=0 cellspacing=1 cellpadding="3" width=670>
- <tr>
- <td align=center>
- <font color=green><b>³»¿ë
º¸±â ȸéÀÔ´Ï´Ù.</b></font>
- </td>
- </tr>
- <tr>
- <td bgcolor="#EAC3EA">
- <table border=0 cellspacing=1 cellpadding=0 width=670 bgcolor="white">
- <tr>
- <td width="100">
- <p
align="right"><b>À̸§ </b></p>
-
- </td>
- <td width="400">
- <p><?
echo $array[name]; ?></p>
- </td>
- <td width="100">
- <p
align="right"><b>Á¶È¸¼ö </b></p>
- </td>
- <td>
- <p><?
echo $array[count]; ?></p>
- </td>
- </tr>
- <tr>
- <td width="100">
- <p
align="right"><b>ÀüÀÚ¿ìÆí </b></p>
- </td>
- <td colspan="3">
- <p><?
echo $array[email]; ?></p>
- </td>
- </tr>
- <tr>
- <td width="100">
- <p
align="right"><b>ȨÆäÀÌÁö </b></p>
- </td>
- <td colspan="3">
- <p><?
echo $array[homepage]; ?></p>
- </td>
- </tr>
- <tr>
- <td width="100">
- <p
align="right"><b>Á¦¸ñ </b></p>
- </td>
- <td colspan="3">
- <p><?
echo $array[subject]; ?></p>
- </td>
- </tr>
- <tr>
- <td width="100">
- <p
align="right"><b>³»¿ë </b></p>
- </td>
- <td colspan="3">
- <p><?
echo $array[memo]; ?></p>
- </td>
- </tr>
- </table>
- <p
align="center"><a href="list.php?page=<? echo $page;
?>">[¸ñ·Ï]</a> <a href="write.php">[¾²±â]</a>
<a href="modify.php?number=<? echo $number; ?>&page=<?
echo $page; ?>">[¼öÁ¤]</a> <a href="delete.php?number=<?
echo $number; ?>&page=<? echo $page; ?>">[»èÁ¦]</a></p>
- </td>
- </tr>
- </table>
- </body>
- </html>
ÀÌ»ó, µ¿Á־ƺü ¼Õº´¸ñÀ̾ú½À´Ï´Ù.
|
|