0
 33   4   1
  View Articles

Name  
   ¼Õº´¸ñ  (2002-12-01 01:43:20, Hit : 30749, Vote : 2931)
Homepage  
   http://www.itmembers.net
Subject  
   °Ô½ÃÆÇ ±Û ³»¿ë »èÁ¦ ±â´É(2) delete_ok.php ¼Ò½º

Áö±Ý±îÁö 4½Ã°£¿¡ °ÉÃÄ ±Û ³»¿ë ¼öÁ¤°ú »èÁ¦ °ü·Ã ¼Ò½º¸¦ ÁÖ~¿í ÈÈ¾î º¸¾Ò½À´Ï´Ù.
´ÙÀ½ ½Ã°£ºÎÅÍ ¾à 3~4ȸ¿¡ °ÉÃÄ ¼Ò½º¿¡ ´ëÇÑ ¼³¸íÀ» ÇÏ°Ú½À´Ï´Ù.

¾Æ·¡´Â delete_ok.php ¼Ò½ºÀÔ´Ï´Ù.
ºñ¹Ð¹øÈ£°¡ ¸ÂÀ¸¸é »èÁ¦ÇÏ°í ±×·¸Áö ¾ÊÀ¸¸é ÀÌÀü È­¸éÀ¸·Î µ¹¾Æ°¡´Â, ºñ±³Àû °£´ÜÇÑ ¼Ò½ºÀÔ´Ï´Ù.


  1. <?
  2. //db ¿¬°á ºÎºÐÀÔ´Ï´Ù.
  3. mysql_connect("localhost", "phpbbs", "phpbbs") or die (mysql_error()); //host,id,passwd
  4. mysql_select_db("itmembers"); //dbÀ̸§
  5.  
  6. //º¯¼ö
  7. $password = addslashes($password);
  8. $tablename="bbs"; //Å×À̺í À̸§
  9.  
  10. //ºñ¹Ð¹øÈ£°¡ ¸Â´ÂÁö È®ÀÎÇÕ´Ï´Ù.
  11. $sql = "select number from $tablename where number=$number and password='$password'";
  12. $result = mysql_query($sql) or die (mysql_error());
  13.  
  14. $msg = "ºñ¹Ð¹øÈ£°¡ Ʋ¸³´Ï´Ù.";
  15.  
  16. if(mysql_num_rows($result)) {  //¹ÝȯµÈ ¿­ÀÌ ÀÖÀ¸¸é...
  17.         //»èÁ¦ÇÕ´Ï´Ù.
  18.         $sql = "delete from $tablename where number=$number";
  19.         mysql_query($sql) or die (mysql_error());
  20.         $msg = "»èÁ¦ÇÏ¿´½À´Ï´Ù.";
  21. }
  22.  
  23. //¸Þ½ÃÁö¸¦ Ãâ·ÂÇÏ°í ¸ñ·Ï ÆäÀÌÁö·Î À̵¿ÇÕ´Ï´Ù.
  24. echo " <html><head>
  25.                 <script name=javascript>
  26.  
  27.                 if('$msg' != '') {
  28.                         self.window.alert('$msg');
  29.                 }
  30.  
  31.                 location.href='list.php?page=$page';
  32.  
  33.                 </script>
  34.                 </head>
  35.                 </html> ";
  36. ?>

ÀÌ»ó µ¿ÁÖ ¾Æºü ¼Õº´¸ñÀ̾ú½À´Ï´Ù.



¼Õº´¸ñ
Äڵ忡 ÷ºÎµÈ ÁÖ¼® ¿Ü¿¡ ´Þ¸® ¼³¸íµå¸± °Ô ¾ø³×¿ä.
ºñ¹Ð¹øÈ£°¡ ¸ÂÀ¸¸é 18ÇàÀÇ Äõ¸®¹®À» ½ÇÇàÇÏ´Â ¸Å¿ì °£´ÜÇÑ ÄÚµåÀÔ´Ï´Ù.
 2002/12/19 14:14:14    
Prev
   [¸¶Áö¸·È¸] 1Â÷ ÇÁ·ÎÁ§Æ®¸¦ Á¾·áÇϸç

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

¼Õº´¸ñ


Copyright 1999-2024 Zeroboard / skin by Zetyx