|
|
|
|
|
0 |
|
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 ÇÁ·Î±×·¥
ºÎºÐÀº ±Û ³»¿ë º¸±â ±â´É°ú °ÅÀÇ À¯»çÇÕ´Ï´Ù. ÀÌ¹Ì ¾Õ¿¡¼ ´Ù »ìÆì º¸¾Ò´ø °ÍÀ̴ϸ¸Å
ºñ±³Àû ½±°Ô ÀÌÇØ°¡ µÉ °ÍÀÔ´Ï´Ù.
¿ì¼± ¼Ò½º¸¦ ÁÖ~¿í »ìÆì º¸½Ã±â ¹Ù¶ø´Ï´Ù.
- <?
- //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]);
-
- ?>
-
- <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>
-
-
- <script language="javascript">
-
- function check_submit() {
-
- if (document.myForm.name.value
== "") {
- alert('À̸§À»
ÀÔ·ÂÇϼ¼¿ä');
- document.myForm.name.focus();
- return;
-
- } else if (document.myForm.password.value
== "") {
- alert('ºñ¹Ð¹øÈ£¸¦
ÀÔ·ÂÇØ¾ß ±ÛÀ» ¼öÁ¤Çϰųª »èÁ¦ÇÒ ¼ö ÀÖ½À´Ï´Ù.');
- document.myForm.password.focus();
- return;
-
- } else if (document.myForm.subject.value
== "") {
- alert('Á¦¸ñÀ»
ÀÔ·ÂÇϼ¼¿ä');
- document.myForm.subject.focus();
- return;
-
- } else if (document.myForm.memo.value
== "") {
- alert('³»¿ëÀ»
ÀÔ·ÂÇϼ¼¿ä');
- document.myForm.memo.focus();
- return;
-
- } else {
- document.myForm.action
= "modify_ok.php";
- document.myForm.submit();
- }
-
- }
-
- </script>
-
- </head>
-
- <body bgcolor=white background=./images/body_bg.gif>
-
- <img src=./images/maintitle.gif>
-
- <br>
-
- <form name='myForm' method='post' >
-
- <input type=hidden name=page value='<? echo
$page; ?>'>
- <input type=hidden name=number value='<?
echo $number; ?>'>
-
- <table border=0 cellspacing=1 cellpadding=0 width=670>
- <tr>
- <td align=center>
- <font color=green><b>±Û
¼öÁ¤ ȸéÀÔ´Ï´Ù.</b></font>
- </td>
- </tr>
- </table>
-
- <table border=0 bgcolor=#CCCCF><tr><td>
-
- <table border=0 width=670 cellspacing=0 cellpadding=0 bgcolor=#F0F0F0>
-
- <col width=100></col><col
width=></col>
-
- <tr>
- <td colspan=2>
- <table
border=0 cellspacing=0 cellpadding=0 width=100%>
-
<tr>
-
<td width=100 align=right><b>À̸§ </b></td>
- <td><input
type=text name=name size=20 maxlength=20 value=
'<? echo $array[name]; ?>'></td>
-
<td width=100 align=right><b>ºñ¹Ð¹øÈ£ </b></td>
- <td><input
type=password name=password size=20 maxlength=20 value=''></td>
-
</tr>
- </table>
- </td>
- </tr>
-
- <tr><td bgcolor=white
height=1 colspan=2></td></tr>
-
- <tr>
- <td align=right><b>ÀüÀÚ¿ìÆí </b></td>
- <td> <input
type=text name=email size=40 maxlength=200 value='<? echo $array[email];
?>'> </td>
- </tr>
-
- <tr><td bgcolor=white
height=1 colspan=2></td></tr>
-
- <tr>
- <td align=right><b>ȨÆäÀÌÁö </b></td>
- <td> <input
type=text name=homepage size=40 maxlength=200 value='<? echo $array[homepage];
?>'> </td>
- </tr>
-
- <tr><td bgcolor=white
height=1 colspan=2></td></tr>
-
- <tr>
- <td align=right><b>Á¦¸ñ </b></td>
- <td> <input
type=text name=subject size=87 maxlength=200 value='<? echo $array[subject];
?>'> </td>
- </tr>
-
- <tr><td bgcolor=white
height=1 colspan=2></td></tr>
-
- <tr>
- <td align=right><b>³»¿ë </b></td>
- <td valign=top>
- <textarea
name=memo cols=85 rows=20> <? echo $array[memo];
?> </textarea>
- </td>
- </tr>
-
- </table>
-
- <br>
-
- <table border=0 width=670>
- <tr><td>
- <center>
- <a href="javascript:check_submit();"><img src='./images/write.gif'
border=0></a>
- <a href="list.php?page=<? echo $page
; ?>"><img src=./images/list.gif border=0></a>
- </center>
- </td></tr>
- </table>
- </td></tr></table>
-
- </form>
-
- </body>
- </html>
|
|