ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

11-1-4 ªO¥D¦^Âкô­¶»P¦^Âиê®ÆÀx¦s

11-1-4 ªO¥D¦^Âкô­¶»P¦^Âиê®ÆÀx¦s

11-1-4   ªO¥D¦^Âкô­¶»P¦^Âиê®ÆÀx¦s
ÁÙ°O±o¡yÅã¥Ü¯d¨¥·N¨£¡zºô­¶¤¤¦pªGªO¥D¥H±K½Xµn¤J¦¨¬°ºÞ²z¼Ò¦¡®É¡A¥²¶·ÅýªO¥D¥i¥H°w¹ï¬Y¦ì¯S©wºô¤Í©Òµoªíªº·N¨£§@¥X¿W¥ßªº¦^À³¶Ü¡H

¹Ï11-14   ¦^Âкô¤Í¯d¨¥ªº¶W³sµ²¡C

­nÅýªO¥D¥i¥H°w¹ï¬Y¦ì¯S©wºô¤Í©Òµoªíªº·N¨£§@¥X¿W¥ßªº¦^À³¡A§Ú­Ì·íµM¤]¥²¶·³]­p¤@­Ó¡yªO¥D¦^ÂЪí³æ¡z¡AÅýªO¥D¯à°÷¦b¤W­±¦^Âеo¨¥¡A¨Ã¥B­n¯à±N³o¨Ç·N¨£¸ê®Æ°eµ¹§Ú­Ì³B²z¦Ñ®v¦^Âиê®ÆªºPHPµ{¦¡¡yanssave.php¡z¨Ó¬ö¿ý¥H¤Î³B²z³o¨Ç¦^Âиê®Æ¡C
¦b³o­Ó¡yªO¥D¦^ÂЪí³æ¡zºô­¶¤¤§Ú­Ì¥²¶·¦A¥t¥~¼¶¼g¤@­ÓPHPµ{¦¡±N¯S©wªººô¤Íµo¨¥¸ê®Æ¨q¦b¨ä¤¤¡A¦nÅýªO¥D¯à°÷¹ïÀ³ºô¤Íµo¨¥¨Ó§@¥X¦^ÂСG

¹Ï11-15  Åã¥Üºô¤Í­ì©lªºµo¨¥¤º®e¡C
  1. <?
  2. $ID = $_REQUEST["ID"];
  3. //³sµ²MySQL Server
  4.     $conn = mysql_connect("localhost", "root", "12345a");
  5. //¿ï¾Ü¸ê®Æ®w
  6.     mysql_select_db("Message", $conn);
  7. //«ü©w´£¨ú¸ê®Æªº®Õ¹ï¦r¤¸ªí
  8.     mysql_query("set character set big5");   
  9. //«Ø¥ß¬d¸ß¦r¦ê
  10. $SQL="SELECT * FROM allmessage WHERE ½s¸¹=" . $ID;
  11. //±N¦^¶Çµ²ªG¦s©ñ©óÅܼƤ¤
  12. $datalist=mysql_query($SQL);
  13. //±N¸ê®Æ¿ýÂà´«¬°Äæ¦ì°}¦C¶°¦X
  14. $fielddatas=mysql_fetch_array($datalist);
  15. ?>
½Æ»s¥N½X
¤W¦C³o­ÓPHPµ{¦¡¤º®e±zÀ³¸Ó¤£­¯¥Í§a¡I¤§«e§Ú­Ì´N¤w¸g½Í¤F«Ü¦h¤F¡C
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

ª¾¹D¦p¦ó±N¯S©wªººô¤Íµo¨¥¸ê®Æ¨q¦bªí³æ¤¤¶Ü¡H¨ä¹ê«Ü²³æ¡A§Ú­Ì¤£¹L¬O±N¸ê®Æ®w¤¤ªº¸ê®Æ¨ú¥X¨Ó¡AµM«á¨q¦bªí³æÄæ¦ì¤¤¦Ó¤w¡G
¡yºô¤Í©m¦W¡zÄæ¦ìºô­¶±Ô­z¼ÐÅÒ
  1. <td bgcolor="#CCCCFF"><font size="2">
  2. <?=$fielddatas["ºô¤Í©m¦W"];?></font></td>
½Æ»s¥N½X
¡y¯d¨¥¥DÃD¡zÄæ¦ìºô­¶±Ô­z¼ÐÅÒ
  1. <td bgcolor="#CCCCFF"><font size="2">
  2. <?=$fielddatas["¯d¨¥¥DÃD"];?></font></td>
½Æ»s¥N½X
¡y¯d¨¥¤º®e¡zÄæ¦ìºô­¶±Ô­z¼ÐÅÒ
  1. <td bgcolor="#CCCCFF"><font size="2">
  2. <?=$fielddatas["¯d¨¥¤º®e"];?></font></td>
½Æ»s¥N½X
¨ä¹ê§Ú­Ì¡yªO¥D¦^ÂЪí³æ¡zªº­«ÂI¬O¦bªO¥D¦^ÂÐÄæ¦ì¤W¡AªO¥D¦b¦^ÂÐÄæ¦ì¤¤©Ò¶ñ¤Jªº¸ê®Æ¡A¥²¶·°eµ¹§Ú­Ì³B²zªO¥D¦^Âиê®ÆªºPHPµ{¦¡¡yanssave.php¡z¨Ó¬ö¿ý¥H¤Î³B²z³o¨Ç¦^Âиê®Æ¡C·íªO¥D¶ñ¼g¦n¦^Âеo¨¥ªº¸ê®Æ«á«ö¤U¡y°e¥X¦^ÂСz«ö¶s«á¡Aªí³æ¤¤ªº¸ê®Æ¤º®e´N·|¥H¡yPOST¡zªº¤è¦¡¥ÑSEVERºÝŪ¨ú¡AµM«á±N¸ê®Æ¤º®e¥æ¥Ñ³B²z¦Ñ®v¦^Âиê®ÆªºPHPµ{¦¡¡yanssave.php¡z¨Ó±N¸ê®Æ¤º®e¼g¤J¸ê®Æ®w¡C
  1. <form method="POST" action="anssave.php">
½Æ»s¥N½X
¯S§Oª`·N¡G·í§Ú­Ì±N¸ê®Æ±q¸ê®Æ®wŪ¥X«á¡A¥²¶·©óµ²§ô«á±N¥´¶}ªº³s½uÃö³¬°_¨Ó¡A¤¤Â_»P¸ê®Æ®wªº³sµ²¡]¨ä¹ê¡A·íºô­¶µ{¦¡±Ô­z¥þ³¡°õ¦æ§¹²¦¡A±N¸ê®Æ¤U¸ü¨ìÂsÄý¾¹®É¡A´N·|¦Û°Ê®ø·À¤F¡^¡A©Ò¥H§Ú­Ì¥²¶·¦bºô­¶¤¤¦A¥[¤J¤U¦C³o¬qPHPµ{¦¡±Ô­z¡G
  1. <?
  2.   mysql_close($conn);
  3. ?>
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

ans.php
  1. <?
  2. $ID = $_REQUEST["ID"];
  3. //³sµ²MySQL Server
  4.     $conn = mysql_connect("localhost", "root", "12345a");
  5. //¿ï¾Ü¸ê®Æ®w
  6.     mysql_select_db("Message", $conn);
  7. //«ü©w´£¨ú¸ê®Æªº®Õ¹ï¦r¤¸ªí
  8.     mysql_query("set character set big5");   
  9. //«Ø¥ß¬d¸ß¦r¦ê
  10. $SQL="SELECT * FROM allmessage WHERE ½s¸¹=" . $ID;
  11. //±N¦^¶Çµ²ªG¦s©ñ©óÅܼƤ¤
  12. $datalist=mysql_query($SQL);
  13. //±N¸ê®Æ¿ýÂà´«¬°Äæ¦ì°}¦C¶°¦X
  14. $fielddatas=mysql_fetch_array($datalist);
  15. ?>

  16. <html>
  17. <head><title>³Â»¶®a±Ú¯d¨¥ªO</title>
  18. <meta http-equiv="Content-Type" content="text/html; charset=big5">
  19. </head>
  20. <body>
  21. <form method="POST" action="anssave.php">
  22.   <input type="hidden" name="ID" value="<?=$ID;?>">
  23.   <div align="center"><center><p><strong><font size="5">ªO¥D·N¨£¦^ÂÐ</font></strong></p>
  24.   </center></div><div align="center"><center>
  25. <table border="0">
  26.   <center></center>
  27.   <TR>
  28.   <td bgcolor="#CCCCFF"><font color="blue" size="2">ºô¤Í©m¦W</font></td>
  29.   <td bgcolor="#CCCCFF"><font size="2"><?=$fielddatas["ºô¤Í©m¦W"];?></font></td>
  30. </tr>
  31. <tr>
  32.   <td bgcolor="#CCCCFF"><font color="blue" size="2" >¯d¨¥¥DÃD</font></td>
  33.   <td bgcolor="#CCCCFF"><font size="2"><?=$fielddatas["¯d¨¥¥DÃD"];?></font></td>
  34. </tr>
  35. <tr>
  36.   <td bgcolor="#CCCCFF"><font color="blue" size="2" >¯d¨¥¤º®e</font></td>
  37.   <td bgcolor="#CCCCFF"><font size="2"><?=$fielddatas["¯d¨¥¤º®e"];?></font></td>
  38. </tr>
  39. <tr>
  40.   <td bgcolor="#CCCCFF"><font size="2" color="#0000FF">ªO¥D</font><font color="blue" size="2" >µªÂÐ</font></td>
  41.   <td bgcolor="#CCCCFF"><font size="2"><textarea rows="5" name="Ans" cols="39"><?=$fielddatas["ªO¥D¦^ÂÐ"];?></textarea></font></td>
  42. </tr>
  43.   </table>
  44.   </center></div><div align="center"><center><input type="submit"
  45.   value="°e¥X¦^ÂÐ">
  46.   </center></div>
  47.   <div align="center"><center>&nbsp;[<a href="guest.asp"><font color="#FF0000"><font onmouseover="this.style.color='#0000BB'" onmouseout="this.style.color='red'">ªð¦^¯d¨¥ªO</font></font></a>]
  48.   </center></div>
  49. </form>
  50. <?
  51.   mysql_close($conn);
  52. ?>
  53. </body>
  54. </html>
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

Àx¦s¦^Âиê®Æ
·íªO¥D¦b¡yªO¥D¦^ÂЪí³æ¡z¤¤¶ñ¼g¦n¦^Âиê®Æ¡AµM«á«ö¤U¡y°e¥X¦^ÂСz«ö¶s¡Aªí³æ¤¤ªº¸ê®Æ¤º®e´N·|¥H¡yPOST¡zªº¤è¦¡¥ÑSEVERºÝŪ¨ú¡A¦]¬°§Ú­Ì¦bªí³æ¶Ç°eªºAction°Ñ¼Æ«ü©wServerºÝ³B²z¦¹¤@ªí³æ¸ê®Æ¤º®eªºµ{¦¡¬°¡yanssave.php¡z¡A¦]¦¹¡A§Ú­Ì´N¥²¶·¨Ó¼¶¼g¯à°÷³B²z³o¨Ç·N¨£¸ê®ÆªºPHPµ{¦¡¡yanssave.php¡z¡C

­n¥H¤U´N¬OPHPµ{¦¡¡yanssave.php¡z§¹¾ãªºµ{¦¡¤º®e¡G
anssave.php
  1. <?
  2. $ID =$_REQUEST["ID"];
  3. $Ans=$_REQUEST["Ans"];

  4. //³sµ²MySQL Server
  5.     $conn = mysql_connect("localhost", "root", "12345a");
  6. //¿ï¾Ü¸ê®Æ®w
  7.     mysql_select_db("Message", $conn);
  8. //«ü©w´£¨ú¸ê®Æªº®Õ¹ï¦r¤¸ªí
  9.     mysql_query("set character set big5");   
  10. //«Ø¥ß¬d¸ß¦r¦ê
  11. $SQL="update allmessage set ªO¥D¦^ÂÐ='" . nl2br($Ans) . "',ªO¥D¦^ÂЮɶ¡='" .
  12.         date("Y-m-j H:i:s") . "' WHERE ½s¸¹=" . $ID;
  13. //¼g¤J¸ê®Æ
  14. mysql_query($SQL);

  15. header("Location: guest.php");
  16. ?>
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

        ÀR«ä¦Û¦b : ±o²z­nÄǤH¡A²zª½­n®ð©M¡C
ªð¦^¦Cªí ¤W¤@¥DÃD