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

13-3-3 ¸Õ¨÷µ{¦¡ºô­¶

13-3-3 ¸Õ¨÷µ{¦¡ºô­¶

13-3-3   ¸Õ¨÷µ{¦¡ºô­¶
¦b¡y½u¤W¦Ò¸Õ¡Ð¸Õ³õ¤jªù¡zºô­¶¤¤¡A§Q¥ÎVB Script µ{¦¡Àˬdªí³æÄæ¦ì¸ê®Æªº¶ñ¼g»PPHPµ{¦¡½T»{¨ü´ú¾Ç¥Íªº¨­¤ÀµL»~«á´N·|¶i¤J¡y½u¤W¦Ò¸Õ¡Ð¸Õ¨÷ºô­¶¡z¨Ó¶i¦æ´úÅç¡A¦b¡y½u¤W¦Ò¸Õ¡Ð¸Õ¨÷ºô­¶¡zªºPHPµ{¦¡¾÷¨î¤¤¤À¬°¨â¤j³¡¤À¡A¤@¬°«Ø¥ß¸ê®Æ®w³sµ²ª«¥ó(Connection)¡B¦s¨ú¸ê®Æ¤º¸ê®Æªíªº¸ê®Æ¡A¥t¤@¬°±NŪ¨ú¶i¨Óªº¡y¦Ò¸ÕÃD¥Ø¡zÅã¥Ü¦bºô­¶¤¤Åý¨ü´ú¾Ç¥Í§@µª¡C

³sµ²¶}±Ò¸ê®Æ®w
¡@­º¥ý§Ú­Ì¥ý¨Ó¬Ý¬Ý¸ê®Æ®w¶i¦æ³sµ²»P¦s¨ú¸ê®Æ®w¤º¸ê®Æªíªº¸ê®ÆªºPHPµ{¦¡¬O¦p¦ó¹B§@ªº¡G
  1. <?
  2. //©Ó±µ¨Ó¦ÛIndoor.phpªº¾Ç¸¹¡B©m¦W¸ê®Æ
  3. $studentname=$_REQUEST["studentname"];
  4. $number=$_REQUEST["number"];
  5. //¶}±Òexam¸ê®Æ®w¤¤ªºask(ÃD¥Ø)¸ê®Æªí
  6. //³sµ²MySQL Server
  7.     $conn = mysql_connect("localhost", "root", "12345a");
  8. //¿ï¾Ü¸ê®Æ®w
  9.     mysql_select_db("exam", $conn);
  10. //«ü©w´£¨ú¸ê®Æªº®Õ¹ï¦r¤¸ªí
  11.     mysql_query("set character set big5");
  12. //´£¨ú¸ê®ÆªºSQL©R¥O¦r¦ê
  13.    $SQL="Select * From ask Order by ÃD¸¹";
  14. //¶i¦æ¸ê®Æ¬d¸ß
  15. $RS=mysql_query($SQL);
  16. ?>
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

¿é¥X¸Õ¨÷±NŪ¨ú¶i¨Óªº¡y¦Ò¸ÕÃD¥Ø¡zÅã¥Ü¦bºô­¶¤¤Åý¨ü´ú¾Ç¥Í§@µª¡A³o¬O¡y½u¤W¦Ò¸Õ¡Ð¸Õ¨÷ºô­¶¡zªº¥t¤@­ÓPHPµ{¦¡¾÷¨î¡A§Ú­Ì±N³z¹L¦¹¾÷¨î§âŪ¨úªº¸ê®Æ®w¦ÒÃD¸ê®Æ¿é¥X¦Üºô­¶¤¤¡C

¹Ï13-16  »â¨ú¸Õ¨÷¡C
  1. <?
  2. //Åã¥Ü¦ÒÃD
  3. //Ū¨ú¸ê®Æªíªº¸ê®Æ¿ýª½¨ì¸ê®Æ¿ý¥þ«×Ū¨ú§¹²¦
  4. //±N¸ê®Æ¿ýÂà´«¬°Äæ¦ì°}¦C¶°¦X
  5. While (($fielddatas=mysql_fetch_array($RS)))
  6. {
  7. //Åã¥ÜÃD¥Ø¤Î°t¤À  
  8.   echo "<hr size=1><font color=blue>" . $fielddatas[2]
  9.       . "¡B" . $fielddatas[3] . "&nbsp&nbsp(" . $fielddatas[9] . "¤À)</font><br>";
  10. //Åã¥Ü³Æ¿ïªºµª®×¶µ¥Ø                 
  11.   For($I=1;$I<=4;$I++)
  12.     {
  13.     echo "<font color=red>¡]" . $I . "¡^</font><input type=Radio "
  14.     . "name='No" . $fielddatas[2] . "' value=" . $I . ">" .
  15.      $fielddatas["µª®×" .$I] ."<br>";
  16.     }
  17. }
  18. ?>
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

        ÀR«ä¦Û¦b : §Ñ¥\¤£§Ñ¹L¡A§Ñ«è¤£§Ñ®¦¡C
ªð¦^¦Cªí ¤W¤@¥DÃD