|
|
|
|
|
0 |
|
View Articles |
|
|
Name |
¼Õº´¸ñ |
(2002-12-01 01:29:06, Hit : 26080, Vote : 2802)
|
|
|
Homepage |
http://www.itmembers.net |
|
Subject |
°Ô½ÃÆÇ ±Û ³»¿ë ¼öÁ¤ ±â´É(2) modify_ok.php ¼Ò½º |
|
|
¼³¸íÀº Á¦31°ºÎÅÍ ÁøÇàÇÏ°Ú½À´Ï´Ù.
ÆÄÀϸí
|
±â´É
|
modify.php
|
±Û ¼öÁ¤ Æû
|
modify_ok.php
|
±Û ¼öÁ¤ DB ó¸® ºÎºÐ
|
delete.php
|
±Û »èÁ¦ Æû
|
delete_ok.php
|
±Û »èÁ¦ DB ó¸® ºÎºÐ
|
¿ì¼± ¼Ò½º¸¦ ÁÖ~¿í »ìÆì º¸½Ã±â ¹Ù¶ø´Ï´Ù.
- <?
- //db ¿¬°á ºÎºÐÀÔ´Ï´Ù.
- mysql_connect("localhost", "phpbbs", "phpbbs")
or die (mysql_error()); //host,id,passwd
- mysql_select_db("itmembers"); //dbÀ̸§
-
- //¼öÁ¤Æû(modify.php)¿¡¼ Àü¼ÛµÈ ³»¿ëÀ» º¯¼ö¿¡ ´ã½À´Ï´Ù.
- $name = addslashes($name);
- $password = addslashes($password);
- $email = addslashes($email);
- $homepage = addslashes($homepage);
- $subject = addslashes($subject);
- $memo = addslashes($memo);
-
- //µðÆúÆ® °ªÀÌ ÇÊ¿äÇÑ º¯¼ö¿¡´Â µðÆúÆ® °ªÀ» ³Ö½À´Ï´Ù.
- $tablename="bbs"; //Å×À̺í À̸§
- $writetime = time();
- //$ip = getenv("REMOTE_ADDR");
-
- //ºñ¹Ð¹øÈ£°¡ ¸Â´ÂÁö È®ÀÎÇÕ´Ï´Ù.
- $sql = "select number from $tablename where
number=$number and password='$password'";
- $result = mysql_query($sql) or die (mysql_error());
-
- if(mysql_num_rows($result)) { //¹ÝȯµÈ
¿ÀÌ ÀÖÀ¸¸é...
- //¼öÁ¤ÇÑ
³»¿ëÀ» UPDATEÇÕ´Ï´Ù.
- $sql = "update
$tablename set
- name='$name',email='$email',homepage='$homepage',
- subject='$subject',memo='$memo'
where number=$number";
- mysql_query($sql) or
die (mysql_error());
- $msg = "¼öÁ¤À»
ÇÏ¿´½À´Ï´Ù.";
-
- echo " <html><head>
- <script
name=javascript>
-
- if('$msg'
!= '') {
- self.window.alert('$msg');
- }
-
- location.href='list.php?page=$page';
-
- </script>
- </head>
- </html>
";
-
- } else {
- $msg = "ºñ¹Ð¹øÈ£°¡
Ʋ¸³´Ï´Ù.";
- echo " <html><head>
- <script
name=javascript>
-
- if('$msg'
!= '') {
- self.window.alert('$msg');
- }
-
- history.go(-1);
-
- </script>
- </head>
- </html>
";
-
- }
-
-
- ?>
|
|