0
 33   4   1
  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 ó¸® ºÎºÐ

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


  1. <?
  2. //db ¿¬°á ºÎºÐÀÔ´Ï´Ù.
  3. mysql_connect("localhost", "phpbbs", "phpbbs") or die (mysql_error()); //host,id,passwd
  4. mysql_select_db("itmembers"); //dbÀ̸§
  5.  
  6. //¼öÁ¤Æû(modify.php)¿¡¼­ Àü¼ÛµÈ ³»¿ëÀ» º¯¼ö¿¡ ´ã½À´Ï´Ù.
  7. $name = addslashes($name);
  8. $password = addslashes($password);
  9. $email = addslashes($email);
  10. $homepage = addslashes($homepage);
  11. $subject = addslashes($subject);
  12. $memo = addslashes($memo);
  13.  
  14. //µðÆúÆ® °ªÀÌ ÇÊ¿äÇÑ º¯¼ö¿¡´Â µðÆúÆ® °ªÀ» ³Ö½À´Ï´Ù.
  15. $tablename="bbs"; //Å×À̺í À̸§
  16. $writetime = time();
  17. //$ip = getenv("REMOTE_ADDR");
  18.  
  19. //ºñ¹Ð¹øÈ£°¡ ¸Â´ÂÁö È®ÀÎÇÕ´Ï´Ù.
  20. $sql = "select number from $tablename where number=$number and password='$password'";
  21. $result = mysql_query($sql) or die (mysql_error());
  22.  
  23. if(mysql_num_rows($result)) {  //¹ÝȯµÈ ¿­ÀÌ ÀÖÀ¸¸é...
  24.         //¼öÁ¤ÇÑ ³»¿ëÀ» UPDATEÇÕ´Ï´Ù.
  25.         $sql = "update $tablename set
  26.                         name='$name',email='$email',homepage='$homepage',
  27.                         subject='$subject',memo='$memo' where number=$number";
  28.         mysql_query($sql) or die (mysql_error());
  29.         $msg = "¼öÁ¤À» ÇÏ¿´½À´Ï´Ù.";
  30.  
  31.         echo " <html><head>
  32.                 <script name=javascript>
  33.  
  34.                 if('$msg' != '') {
  35.                         self.window.alert('$msg');
  36.                 }
  37.  
  38.                 location.href='list.php?page=$page';
  39.  
  40.                 </script>
  41.                 </head>
  42.                 </html> ";
  43.  
  44. } else {
  45.         $msg = "ºñ¹Ð¹øÈ£°¡ Ʋ¸³´Ï´Ù.";
  46.         echo " <html><head>
  47.                 <script name=javascript>
  48.  
  49.                 if('$msg' != '') {
  50.                         self.window.alert('$msg');
  51.                 }
  52.  
  53.                 history.go(-1);
  54.  
  55.                 </script>
  56.                 </head>
  57.                 </html> ";
  58.  
  59. }
  60.  
  61.  
  62. ?>

Prev
   °Ô½ÃÆÇ ±Û ³»¿ë »èÁ¦ ±â´É(1) delete.php ¼Ò½º [1]

¼Õº´¸ñ
Next
   °Ô½ÃÆÇ ±Û ³»¿ë ¼öÁ¤ ±â´É(1) modify.php ¼Ò½º

¼Õº´¸ñ


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