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

[±Ð¾Ç] (¹ê¾Ô±MÃD) ¸ê®Æ®wÁpµ¸Ã¯ ¤¤½g

[±Ð¾Ç] (¹ê¾Ô±MÃD) ¸ê®Æ®wÁpµ¸Ã¯ ¤¤½g

¯d¨¥Åã¥Üºô­¶ªººÞ²z¼Ò¦¡
§Ú­Ìªº¡y®a®xÁpµ¸Ã¯¡z¦]¬°¥²¶·¨ã³Æµo¨¥¤º®e¯A¤Î±Ó·P¸ÜÃD©Î¬O¯A¤Î¨p¤HÁô¨pªº®aªøµo¨¥¥i¥Î¡y®¨®¨¸Ü¡zªº¤è¦¡µo¨¥»PÅã¥Ü¡A¦P®É¤]§Æ±æ¦Ñ®v¯à°w¹ï¬Y¦ì¯S©w¾Ç¥Í®aªø©Òµoªíªº·N¨£§@¥X¿W¥ßªº¦^À³¡A¦]¦¹¡A§Ú­Ì¡yÅã¥Ü¯d¨¥·N¨£¡zªººô­¶´N¥²¶·¨ã³ÆÅã¥Ü¼Ò¦¡¿ï¾Üªº¥\¯à¡A·íÅã¥Ü¼Ò¦¡¦b¤@¯ë±¡ªp®É­n¯àÅã¥Ü®aªø­Ìªº¤@¯ë©Êµo¨¥¡A¦P®ÉÁÙ±o±N¡y®¨®¨¸Ü¡zªºµo¨¥ÁôÂð_¨Ó¡G

11-9.png

    ·í¦Ñ®v¥H±K½Xµn¤J¦¨¬°ºÞ²z¼Ò¦¡®É¡A«h¥²¶·±N¤@¯ë©Êµo¨¥»P®¨®¨¸Üµo¨¥ªº¸ê®Æ¥þ³¡Åã¥Ü¥X¨Ó¡A¦P®ÉÁÙ±oÅý¦Ñ®v­Ì¥i¥H°w¹ï¬Y¦ì¯S©w¾Ç¥Í®aªø©Òµoªíªº·N¨£§@¥X¿W¥ßªº¦^À³¡G



±K½Xµn¤JºÞ²z¼Ò¦¡ªºASPµ{¦¡

±zÀ³¸Óµo²{¨ì¡G·í§Ú­Ì¦b¤@¯ëÅã¥Ü¼Ò¦¡®É(¤£·|Åã¥Ü®¨®¨¸Üªºµo¨¥)¡A¦bºô­¶³Ì¤U¤è±N·|¦³¤@­Ó¿é¤J±K½X¶i¤J¡y±Ð®vºÞ²z¡z¼Ò¦¡ªºÄæ¦ì¡A¦Ó·í§Ú­Ì¥H±K½Xµn¤JºÞ²z¼Ò¦¡®É¡A«h¦bºô­¶³Ì¤U¤è·|¦³¤@­Ó¡yÂ÷¶}ºÞ²z¼Ò¦¡¡zªº«ö¶s¡I

§Ú­Ì¥ý¨Ó¬Ý¬Ý³o¨â­Ó±¡ªp¬O¦p¦ó²£¥Íªº¡A½Ð¥ýÀ˵ø¤U¦C³o¬qºô­¶±Ô­z¡G
  1. <!--------ºÞ²z¼Ò¦¡¿ï¾Ü----------->
  2. <form method="post">
  3. <%IF session("checkedit")="yes" then%>
  4. <input type="hidden" value="yes" name="goexit">
  5. <input type="submit" value="Â÷¶}ºÞ²z¼Ò¦¡">
  6. <%else%>
  7. ±K½X¡G
  8. <input type="text" name="password"
  9. size="4"maxlength="4">
  10. &nbsp&nbsp<input type="submit" value="±Ð®vºÞ²z">
  11. <%End IF%>
  12. </form>
½Æ»s¥N½X
¦b¤W­±³o¬qºô­¶±Ô­z¤¤¡A§Ú­Ì¥i¥H²M·¡ªºª¾¹D­nÅã¥Ü¤@¯ë¼Ò¦¡©ÎºÞ²z¼Ò¦¡¡A§¹¥þ±o¾a¤@­ÓSessionª«¥ó¨Ó¨M©w¡ISession ª«¥ó¬°¬ö¿ý¨Ï¥ÎªÌªº¬ÛÃö¸ê°T¡A´£¨Ñ¨Ï¥ÎªÌ¦A¦¸¹ï¦¹ºô­¶¦øªA¾¹­n¨D®É§@½T»{¡A¨Ò¦p¨Ï¥ÎªÌ±b¸¹»P±K½Xªº½T»{¡A¦³ Session ª«¥óªº«Ø¥ß¡A¨Ó«O¯d¨­¤À»{ÃÒªºµ²ªG¡A«h¨Ï¥ÎªÌ¤£¥Î©ó¨C¤@­¶ºô­¶ µn¿ý®É³£»Ý¿é¤J±K½X§@½T»{¡C¦b¥»½d¨Ò¤¤¡A§Ú­Ì«h§Q¥ÎSessionª«¥ó¨Ó°O¿ý¥Ø«eªº¤u§@¼Ò¦¡¡C


¡@¬JµM§Ú­Ì¬O§Q¥ÎSessionª«¥ó¨Ó°O¿ý¥Ø«eªº¤u§@¼Ò¦¡¡A¨º§Ú­Ì¸Ó¦p¦óÅܧóSessionª«¥ó°O¿ýªº¡yÅܼơz­È©O¡H«Ü®e©ö¡I½Ð±µµÛ¨Ó¬Ý¬Ý§Ú­ÌºÞ²z¼Ò¦¡ªºASPµ{¦¡¡G
  1. '¥H¤U¬°¶i¤JºÞ²z¼Ò¦¡ªº±Ô­z
  2. password=Request.Form("password")
  3. IF password="test" then '<-----ºÞ²z±K½X
  4. session("checkedit")="yes"
  5. End IF
  6. '¥H¤U¬°²æÂ÷ºÞ²z¼Ò¦¡ªºµ{¦¡±Ô­z
  7. goexit=Request.Form("goexit")
  8. IF goexit="yes" then
  9. session("checkedit")="no"
  10. End IF
½Æ»s¥N½X
·í§Ú­Ì²Ä¤@¦¸¶i¤J¡yÅã¥Ü¯d¨¥·N¨£¡zºô­¶ªº®É­Ô¡A§Ú­Ì©Ò¨£ªººô­¶µe­±¤@©w¬O¤@¯ë¼Ò¦¡¡I¬°¤°»ò¡H¦]¬°Session©|¥¼³Q«Ø¥ß¡A¦]¦¹¥¦ªº¡yÅܼơz­È¤@©w¤£·|¬O"yes"¡A©Ò¥Hºô­¶¤¤·|¥X²{¤@­Ó¿é¤J±K½X¶i¤J¡y±Ð®vºÞ²z¡z¼Ò¦¡ªºÄæ¦ì¡A¥u¦³·í§Ú­Ì¿é¤J±K½X«ö¤U¡y±Ð®vºÞ²z¡zªº«ö¶s¤ÞµoASPµ{¦¡¤¤ªº¶i¤JºÞ²z¼Ò¦¡±Ô­z«á¡ASessionª«¥ó¤~·|³Q«Ø¥ß¡A¦P®É¡A¡ycheckedit¡zSessionª«¥óÅܼƭȳQ³]©w¬°"yes"¡A©Ò¥H§Ú­Ì´N¶i¤J¤F¯à±N¤@¯ë©Êµo¨¥»P®¨®¨¸Üµo¨¥ªº¸ê®Æ¥þ³¡Åã¥Ü¥X¨Ó¡A¦P®ÉÁÙÅý¦Ñ®v­Ì¥i¥H°w¹ï¬Y¦ì¯S©w¾Ç¥Í®aªø©Òµoªíªº·N¨£§@¥X¿W¥ß¦^À³ªººÞ²z¼Ò¦¡­¶­±¡C

11-11.png

·í§Ú­Ì¶i¤JºÞ²z¼Ò¦¡­¶­±«á¡A§A±Nµo²{ºô­¶³Ì¤U¤è¡A­ì¥»ªº±K½Xµn¤JÄæ¦ì¤£¨£¤F¡A¦Ó¥H¡yÂ÷¶}ºÞ²z¼Ò¦¡¡zªº«ö¶s¨ú¥N¡A³o¬O¦]¬°Sessionª«¥ó³Q«Ø¥ß¤F¡A¦Ó¥BÅܼƭȳQ³]©w¬°"yes"¡Aºô­¶¤¤ªº±Ô­z´NÅܬ°¡G
  1. <input type="hidden" value="yes" name="goexit">
  2. <input type="submit" value="Â÷¶}ºÞ²z¼Ò¦¡">
½Æ»s¥N½X
11-12.png

    ¦b§Ú­Ì­n²æÂ÷ºÞ²z¼Ò¦¡¦Ó«ö¤U¡yÂ÷¶}ºÞ²z¼Ò¦¡¡zªº«ö¶s«á¡A«h·|¤Þµo²æÂ÷ºÞ²z¼Ò¦¡ªºASPµ{¦¡±Ô­z¡G
  1. '¥H¤U¬°²æÂ÷ºÞ²z¼Ò¦¡ªºµ{¦¡±Ô­z
  2. goexit=Request.Form("goexit")
  3. IF goexit="yes" then
  4. session("checkedit")="no"
  5. End IF
½Æ»s¥N½X
¦¹®É§Ú­Ì±N¦^¨ì¤@¯ë¼Ò¦¡ªº­¶­±¡A¦Ó¥BSessionª«¥óÅܼƭȳQ³]©w¬°"no"¡Aºô­¶¤¤ªº±Ô­z´NÅܬ°¡G
  1. <input type="text" name="password" size="4"
  2. maxlength="4">
  3. &nbsp&nbsp<input type="submit" value="±Ð®vºÞ²z">
½Æ»s¥N½X
¦Óºô­¶¤¤ªº¡yÂ÷¶}ºÞ²z¼Ò¦¡¡z«ö¶s¡A¤]´NÅܦ^¿é¤J±K½X¶i¤J¡y±Ð®vºÞ²z¡z¼Ò¦¡ªºÄæ¦ì¡C


´£¥Ü
³o­Ó±±¨îÅã¥Ü¼Ò¦¡ªºSessionª«¥ó«D±`­«­n¡A¥¦¤£¶È¬O±±¨î§Ú­ÌªºÅã¥Ü¼Ò¦¡¡A¦P®É§Ú­ÌÁÙ±N§Q¥Î¥¦ªºÅܼƭȨӨM©w¬O§_Åã¥Ü¾Ç¥Í®aªøªº®¨®¨¸Üµo¨¥¤º®e¡I
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

µo¨¥ªí³æºô­¶»s§@
·í§Ú­Ì­n¦bºô­¶¤¤´£¨Ñ¤@­Ó¥i¥HÅý¾Ç¥Í®aªøµoªí·N¨£©Î¤Ï¬MªºÁpµ¸Ã¯®É¡A§Ú­Ì­º¥ý¥²¶·³]­p¤@­Ó¡y·N¨£µoªíªí³æ¡z¡AÅý¾Ç¥Í®aªø¥i¥H¦b¤W­±µoªí·N¨£¡A¨Ã¥B­n¯à±N³o¨Ç·N¨£¸ê®Æ°eµ¹§Ú­Ì³B²z®aªøµo¨¥¸ê®ÆªºASPµ{¦¡¡yadd.asp¡z¨Ó¬ö¿ý¥H¤Î³B²z³o¨Ç·N¨£¸ê®Æ¡C

    ²{¦b§Ú­Ì´N¨Ó»s§@¤@­Ó¥i¥HÅý¾Ç¥Í®aªø¥i¥H¦b¤W­±µoªí·N¨£ªºªí³æºô­¶¡yaddmsg.asp¡z¡G

11-17.png

½s¸¹

Äæ¦ì

Äæ¦ì¦WºÙ

ªí³æ¤¸¥ó

¢°

¯d¨¥¥DÃD

subject

³æ¦æ¤å¦r¤è¶ô

¢±

±zªº¤j¦W

parent

³æ¦æ¤å¦r¤è¶ô

¢²

E-Mail

email

³æ¦æ¤å¦r¤è¶ô

¢³

ª¨ª¨ÁÙ¬O¶ý¶ý

dadmam

¿ï¾Ü¶s

¢´

¯d¨¥©Ê½è

personal

¤U©Ô¦¡¥\¯àªí

¢µ

¯d¨¥¤º®e

memo

¦h¦æ¤å¦r¤è¶ô

¢¶

°e¥X·N¨£

Submit

«ö¶s

¢·

²M°£­«¼g

¡þ

«ö¶s



¡y¯d¨¥¥DÃD¡zºô­¶±Ô­z¼ÐÅÒ
  1. <input type="text" name="subject" size="50" maxlength="20">
½Æ»s¥N½X
¡y±zªº¤j¦W¡zºô­¶±Ô­z¼ÐÅÒ
  1. <input type="text" name="parent" size="20" maxlength="20">
½Æ»s¥N½X
¡yE-Mail¡zºô­¶±Ô­z¼ÐÅÒ
  1. <input type="text" name="email" size="35" maxlength="40">
½Æ»s¥N½X
¡yª¨ª¨ÁÙ¬O¶ý¶ý¡zºô­¶±Ô­z¼ÐÅÒ
  1. <input type="radio" name="dadmam" value="1" checked >
  2. <img src="1.gif">
  3. <input type="radio" name="dadmam" value="2">
  4. <img src="2.gif">
½Æ»s¥N½X
¡y¯d¨¥©Ê½è¡zºô­¶±Ô­z¼ÐÅÒ
  1. <select name="personal" size="1">
  2. <option value="¤j®a¨Ó°Q½×" selected>¤j®a¨Ó°Q½×</option><option value="¥uµ¹¦Ñ®v¬Ý">¥uµ¹¦Ñ®v¬Ý</option>
  3. </select>
½Æ»s¥N½X
¡y¯d¨¥¤º®e¡zºô­¶±Ô­z¼ÐÅÒ
  1. <textarea name="memo" cols="50" rows="2" ></textarea>
½Æ»s¥N½X
½Ð¯S§Oª`·N¡G§Ú­Ìªí³æªº¦WºÙ¬°¡yAddmsg¡z¡A¦Óªí³æ¤º®e¸ê®Æªº¶Ç°e¤è¦¡¬°¡yPost¡z¡A¦Ó¥B·í³o¨Ç·N¨£¸ê®Æ³Q°e¹F¨ì IIS/PWS «á¡AIIS/PWS ªººô¸ô¦øªA¾¹ºÝ­t³d³B²z·N¨£¸ê®ÆªºASPµ{¦¡¬O¡yadd.asp¡z.
  1. <form name="addmsg" method="POST" action="add.asp">
½Æ»s¥N½X
¬ÛÃöª¾ÃÑ¡Gªí³æªº°Ñ¼Æ

  • ªí³æªºAction°Ñ¼Æ¡GAction°Ñ¼Æ¬O¥Î¨Ó«ü©wServerºÝ³B²z¦¹¤@ªí³æ¸ê®Æ¤º®eªºµ{¦¡¡A¦b¥»¨Ò¤¤§Ú­Ì¤w¸g·Ç³Æ¤F¤@­Ó±MÄݪºªí³æ³B²zASPµ{¦¡¡yadd.asp¡z¡A©Ò¥H§Ú­Ì±N¦¹°Ñ¼Æ­È©w¬°¡yadd.asp¡z¡C

  • ªí³æªºMothed°Ñ¼Æ¡G­n±Nªí³æ¸ê®Æ¶Ç°e¦ÜServerºÝªº¤è¦¡¦³¨âºØ¡A³]©w­È¤À§O¬°GET¤ÎPOST¡A­Y³]©w¬°POST¡A«hÂsÄý¾¹·|µ¥ServerºÝ¨ÓŪ¨ú¸ê®Æ¡A­Y³]©w¬°GET¡A«h·í§Ú­Ì«ö¤U°e¥X«ö¶s®É¡AÂsÄý¾¹·|¥ß§Y±Nªí³æ¤¤ªº¸ê®Æ¤º¶Ç°e¥X¥h¡C§Q¥ÎPOST¤èªk¡A¦b¶Ç°eªº¸ê®Æ¤W±N¤£¨ü­­¨î¡A§Q¥ÎGET¤èªk¶Ç°eªº¸ê®Æ¶q«h¤j¬ù¥u¦³¢±k¥ª¥k¡A¦ý¬OGET¤èªkªº°õ¦æ®Ä¯à¤ñ¸û°ª¡C



addmsg.asp
  1. <html>
  2. <head>
  3. <meta http-equiv="Content-Type" content="text/html; charset=big5">
  4. <title>®a®xÁpµ¸Ã¯</title>
  5. </head>
  6. <body>
  7. <div align="center">
  8. <p align="center">
  9. <font size="2">
  10. <img src="title.gif">
  11. </font>
  12. </div>
  13. <div align="center">
  14. <p align="right"><a href="guest.asp" ><font size="2">¬Ý®aªø­Ìªº·N¨£</font></a>
  15. </div>
  16.   <form name="addmsg" method="POST" action="add.asp">
  17. <div align="center">
  18. <table border="0" cellspacing="1" width="100%">
  19. <tr>  
  20. <td bgcolor="#3399FF" align="center" valign="middle" width="147"><font color="#FFFFFF" size="2">¯d¨¥¥DÃD</font></td>
  21. <td height="25" bgcolor="#99CCFF" width="382"><font size="2"><input type="text" name="subject" size="50" value maxlength="20"></font></td>  
  22.   </tr>  
  23. <tr>  
  24. <td bgcolor="#3399FF" align="center" valign="middle" width="147"><font color="#FFFFFF" size="2">±zªº¤j¦W</font></td>  
  25. <td height="25" bgcolor="#99CCFF" width="382"><font size="2"><input type="text" name="parent" size="20" maxlength="20"></font></td>  
  26. </tr>  
  27. <tr>
  28. <td bgcolor="#3399FF" align="center" valign="middle" width="147"><font color="#FFFFFF" size="2">E-Mail</font></td>  
  29. <td height="25" bgcolor="#99CCFF" width="382"><font size="2"><input type="text" name="email" size="35" maxlength="40"></font></td>  
  30. </tr>  
  31.   <tr>  
  32. <td bgcolor="#3399FF" align="center" height="27" valign="middle" width="147"><font color="#FFFFFF" size="2">±z¬Oª¨ª¨ÁÙ¬O¶ý¶ý¡H</font></td>  
  33. <td height="27" bgcolor="#99CCFF" width="382">
  34. <font size="2">
  35. <input type="radio" name="dadmam" value="1" checked ><img src="1.gif">  
  36. <input type="radio" name="dadmam" value="2"><img src="2.gif">  
  37. </font>  
  38. </td>
  39.   </tr>  
  40. <!--¨p¤H¯d¨¥©Î¤½¶}-->
  41. <tr>  
  42. <td bgcolor="#3399FF" align="center" width="147"><font color="#FFFFFF" size="2">¯d¨¥©Ê½è</font></td>
  43. <td bgcolor="#99CCFF" width="382">
  44. <font size="2">  
  45. <select name="personal" size="1">  
  46.   <option value="¤j®a¨Ó°Q½×" selected>¤j®a¨Ó°Q½×</option>
  47.   <option value="¥uµ¹¦Ñ®v¬Ý">¥uµ¹¦Ñ®v¬Ý</option>
  48. </select>
  49. </font>
  50. </td>
  51.   </tr>  
  52. <!--¯d¨¥¤º®eÄæ¦ì-->  
  53. <tr>
  54. <td bgcolor="#3399FF" align="Center" height="98" valign="middle" width="147"><font color="#FFFFFF" size="2">¯d¨¥¤º®e¡G</font>
  55. </td>  
  56. <td height="98" valign="middle" bgcolor="#99CCFF" width="382">
  57.   <font size="2">
  58.   <textarea name="memo" cols="50" rows="2" ></textarea>  
  59.   </font>  
  60. </td>
  61. </tr>  
  62.   </table>  
  63. </div><div align="center"><center><p><font size="2"><input type="submit"  value="°e¥X·N¨£">
  64. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <input type="reset" value="­«¶ñ¸ê®Æ"> </font> </p>  
  65.   </div>  
  66.   </form>  
  67. </center>
  68. </body>  
  69. </html>
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

§¹¾ãªº¯d¨¥Åã¥Üºô­¶
²×©ó§¹¦¨¤F¡yÅã¥Ü¯d¨¥·N¨£¡zºô­¶¤¤¦U¶µ¥\¯àªºASPµ{¦¡¼¶¼g¡A³Ì«á´N²³æªº¨Ó¬°±z¸Ñ»¡¤@¤U¡y¸ê®ÆÅã¥Ü¡zªº³B²z­ì«h¡A§Ú­Ì¥H¡yµo¨¥¤º®e¡z¬°¨Ò¨Ó»¡©ú¡C

11-15.png

      §Ú­Ì¦p¦ó§PÂ_­n¤£­n±N¡y®¨®¨¸Ü¡zªºµo¨¥¤º®eÅã¥Ü¥X¨Ó¡H¦³¨â­Ó§PÂ_­ì«h¡G²Ä¤@¬°½T»{¬O¤£¬O¦b¡yºÞ²z¼Ò¦¡¡z¡A¦pªG¬O¦bºÞ²z¼Ò¦¡´N±o±N¡y®¨®¨¸Ü¡zªºµo¨¥¤º®eÅã¥Ü¥X¨Ó¡A²Ä¤G´N¬O¦pªG¦b¡y¤@¯ë¼Ò¦¡¡zªº®É­Ô§PÂ_µo¨¥©Ê½è¬O¤£¬O¡y®¨®¨¸Ü¡z¡A¦]¦¹¬O¡A«hµo¨¥ªº¤º®e´N¥H¹w³]ªº¤å¦r¤º®e¥N´À¡G
  1. <% IF RS("¨p¤H¤½¶}") = "NO" OR
  2. session("checkedit")="yes" THEN%>
  3. <font color="#FF0080">¯d¨¥¥DÃD¡G</font>
  4. <font color="#0000FF"><%=RS("¯d¨¥¥DÃD")%></font>
  5. <br><font color="#000000"><%=RS("¯d¨¥¤º®e")%></font>
  6. <%ELSE%>
  7. <FONT COLOR=BLUE>:) ³o¬O¯dµ¹¦Ñ®vªº®¨®¨¸Ü...</FONT>
  8. <br><font color="#FF00F00">¨p¤H°Q½×</font>
  9. <%END if%>
½Æ»s¥N½X
§Ú­Ì¥ý§Q¥ÎIF§PÂ_¸ê®Æ®wÀɮפ¤¡y¨p¤H¤½¶}¡zÄæ¦ì¤¤ªº¸ê®Æ¤º®e¬O§_¬O"NO"¡A¦pªG¬°"NO"¥Nªí¨Ã¤£¬O¡y®¨®¨¸Ü¡zªºµo¨¥¡A«h¶}±Nµo¨¥¤º®e¤½¶}¥X¨Ó¡A¤S©ÎªÌSessionª«¥óªºÅܼÆ"checkedit"­È¬°"yes"¡A¦pªGSessionª«¥óªºÅܼƭȬ°¡@"yes"¡A¥Nªí¦bºÞ²z¼Ò¦¡¡A´N¥²¶·±N¡y®¨®¨¸Ü¡zªºµo¨¥Åã¥Ü¥X¨Ó¡G

11-16.png

guest.asp
  1. <%
  2. '*************¶}±Ò¸ê®Æ®wmessage.mdb
  3. Set CN = Server.CreateObject("ADODB.Connection")
  4. CN.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ="&Server.MapPath("message.mdb")
  5. Set RS=Server.CreateObject("ADODB.Recordset")
  6. SQL="SELECT*From allmessage order by ¯d¨¥¤é´Á Desc"
  7. RS.Open SQL,CN,1,1
  8. '**************Åã¥Ü­¶¿ï¾Ü»P¤À­¶³]©w
  9. '¸ê®ÆÁ`¼ÆCount,Á`­¶¼ÆTotalPage
  10. Count=RS.RecordCount
  11. If Count/10 > (Count\10) then
  12. TotalPage=(Count\10)+1
  13. else TotalPage=(Count\10)
  14. End If

  15. PageCount= 0
  16. RS.MoveFirst
  17. if Request.QueryString("ToPage")<>"" then PageCount = cint(Request.QueryString("ToPage"))
  18. if PageCount <=0 then PageCount = 1
  19. if PageCount > TotalPage then PageCount = TotalPage
  20. RS.Move (PageCount-1) * 10
  21. '***************ºÞ²z¼Ò¦¡ÀËÅç
  22. '¥H¤U¬°¶i¤JºÞ²z¼Ò¦¡ªº±Ô­z
  23. password=Request.Form("password")
  24. IF password="test" then '<-----ºÞ²z±K½X
  25.   session("checkedit")="yes"
  26. End IF
  27. '¥H¤U¬°²æÂ÷ºÞ²z¼Ò¦¡ªºµ{¦¡±Ô­z
  28. goexit=Request.Form("goexit")
  29. IF goexit="yes" then
  30. session("checkedit")="no"
  31. End IF
  32. %>
  33. <html>
  34. <head>
  35. <meta http-equiv="Content-Type" content="text/html; charset=big5">
  36. <title>®a®xÁpµ¸Ã¯</title>
  37. </head>
  38. <body>
  39. <div align="center">
  40. <img src="title.gif"><br><a href="addmsg.asp">®aªøµo¨¥½Ð«ö¦¹</a>
  41. </div>
  42. <center>
  43. <form method="post" name="formpage">
  44. <!-------Åã¥Ü­¶¿ï¾Ü»P¤À­¶³]©w---------->
  45. <table border="0" width="100%" cellpadding="0" cellspacing="0">
  46. <tr>
  47. <td><p align=right>
  48. <%
  49. for i=1 to TotalPage
  50.   If i<>PageCount then
  51.   Response.Write "<font color=black>¡U</font><a href=guest.asp?topage="& i &"><font color=#cb55cc>" & i & "</font></a><font color=black>¡U</font>"
  52.   else
  53.   Response.Write "<font color=black>¡U</font><font color=#000000>"&i&"</font><font color=black>¡U</font>"
  54.   end if
  55. next
  56. %>
  57.   </p>
  58. </td>
  59. <td align=right>
  60. ¦@<%=Count%>µ§¯d¨¥&nbsp&nbsp²Ä <% =PageCount %> ­¶ / ¦@ <% =TotalPage %> ­¶</td>
  61. </tr></table>
  62. <hr size="1" align="center" width="100%" >
  63. </form>
  64. <!-----Ū¤J»PÅã¥Ü¸ê®Æ¿ý----->
  65. <%
  66. i=0
  67. Do While Not RS.EOF and i<10
  68. i=i+1
  69. %>
  70. <table border=0 width=90% bgcolor=#99CCFF>
  71. <tr>
  72. <td><fieldset id=info align=center style='margin:5'>
  73.   <img src="<% =RS("ª¨¶ý") %>.gif" border="0">&nbsp<%=RS("®aªø©m¦W")%>&nbsp©ó<% =RS("¯d¨¥®É¶¡") %>µoªí&nbsp&nbsp
  74. <% if len(TRIM(RS("Ápµ¸«H½c")))<>0 then %> <a href="mailto:<% =RS("Ápµ¸«H½c") %>">
  75. <img src="mail.gif" alt="Ápµ¸«H½c <% =RS("Ápµ¸«H½c") %>" border="0"></a>
  76. <% end if %>
  77. <table border="0" width=100%>
  78.   <tr>
  79. <td  valign="top" align="left">
  80. <% IF RS("¨p¤H¤½¶}") = "NO" OR session("checkedit")="yes" THEN%>
  81. <font color="#FF0080">¯d¨¥¥DÃD¡G</font>
  82. <font color="#0000FF"><%=RS("¯d¨¥¥DÃD")%></font>
  83. <br><font color="#000000"><%=RS("¯d¨¥¤º®e")%></font>
  84. <%ELSE%>
  85. <FONT COLOR=BLUE>:) ³o¬O¯dµ¹¦Ñ®vªº®¨®¨¸Ü...</FONT>
  86.   <br><font color="#FF00F00">¨p¤H°Q½×</font>
  87. <%END if%>
  88.   </td></tr>
  89. <%if RS("¦Ñ®v¦^ÂÐ")<>"" then%>
  90. <tr bgcolor="#3399FF">
  91.   <td align="left" valign=top >  
  92.   <font color="#800000">¦Ñ®v©ó<%=RS("¦Ñ®v¦^ÂЮɶ¡")%>¦^ÂСG</font>
  93.   <br>
  94. <font color="FFFFFF"><%=RS("¦Ñ®v¦^ÂÐ")%></font>
  95. </td></tr>
  96.   <% end if%>
  97.   <% IF session("checkedit")="yes" then %>
  98. <tr><td>
  99.   <DIV ALIGN=RIGHT>¡i<a href=teachans.asp?ID=<%=RS("½s¸¹")%>>¦Ñ®v¦^ÂÐ</a>¡j</DIV>
  100. </td></tr>
  101.   <%END IF%>
  102. </table>
  103. </td></tr></table><br>
  104. <% RS.MoveNext
  105. loop
  106. RS.Close
  107. CN.Close
  108. %>
  109. <p>
  110. <!-----ºÞ²z¼Ò¦¡¿ï¾Ü---------->
  111. <form method="post">
  112. <%IF session("checkedit")="yes" then%>
  113. <input type="hidden" value="yes" name="goexit">
  114. <input type="submit" value="Â÷¶}ºÞ²z¼Ò¦¡">
  115. <%else%>
  116. ±K½X¡G<input type="text" name="password" size="4" maxlength="4">&nbsp&nbsp<input type="submit" value="±Ð®vºÞ²z">
  117. <%End IF%>
  118. </form>
  119. </center>
  120. </body>  
  121. </html>  
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

¯d¨¥Åã¥Üºô­¶ªº¤À­¶

¨ì²{¶¥¬q¡A§Ú­Ì¤w¸g§¹¦¨¡yÅã¥Ü¯d¨¥·N¨£¡zºô­¶ªº¡yºÞ²z¼Ò¦¡¡z³B²z»P¡y¸ê®Æ®w¸ê®ÆŪ¨ú¡zªºASPµ{¦¡¼¶¼g¡C²{¦b§Ú­Ì±µµÛ¶i¦æ¡yÅã¥Ü¯d¨¥·N¨£¡zºô­¶ªº¤À­¶ÂsÄýµ{¦¡¼¶¼g¡C

ÁÙ¬°¦ó»Ý­n¶i¦æ¤À­¶ÂsÄý¡H¦]¬°·í®aªøªºµo¨¥»P¦Ñ®v¦^ÂЪº¸ê®Æµ§¼Æ¤Ó¦h®É¡A¤@¦¸­n±N¥þ³¡ªº¸ê®Æ¤º®eÅã¥Ü¦bºô­¶¤¤¡A¥ú¬Oµ¥«Ýºô­¶¤U¸üªº®É¶¡´NÀ~¦º¤H¤F¡A¦]¦¹§Ú­Ì³Ì¦n¬O±Ä¥Î©T©wµ§¼Æ¤À­¶ÂsÄýªº¤è¦¡¨ÓÅã¥Üºô­¶¡C

­n¶i¦æ¤À­¶Åã¥Ü¡A­º¥ý§Ú­Ì±o¥ýª¾¹D¥Ø«e¦³¦h¤Öµ§ªº¯d¨¥¸ê®Æ¡A¦Ó³o¨Ç¯d¨¥¸ê®Æµ§¼Æ¥i¤À¸Ñ¦¨´X­Ó­¶¦¸¨ÓÂsÄý¡A­n·Q¸ê®Æ¸ê®ÆÀɮפ¤¥Ø«e¦³´Xµ§¸ê®Æ¿ý¡A§Ú­Ì¥i¥H³z¹LRecordsetª«¥óªº¡yRecordCount¡zÄݩʱoª¾¡A¨Ò¦p¡G¥»¨Ò¤¤§Ú­Ì±N¨C¢°¢¯µ§¸ê®Æ¬°¤@³æ¦ì¤À­¶Åã¥Ü¡G
  1. '¸ê®ÆÁ`¼ÆCount,Á`­¶¼ÆTotalPage
  2. Count=RS.RecordCount
  3. If Count/10 > (Count10) then
  4. TotalPage=(Count10)+1
  5. else TotalPage=(Count10)
  6. End If
½Æ»s¥N½X
§Ú­Ì¥ý§Q¥ÎÅܼơyCount¡z¨Ó°O¿ý¸ê®Æ®wÀɮפ¤¦@¦³¦h¤Öµ§¸ê®Æ³o­ÓÁ`µ§¼Æ§Ú­Ì±NÅã¥Ü¦bºô­¶¤¤¡A­nª¾¹DÁ`¦@¦³¦h¤Ö­¶(TotalPage)§Ú­Ì¥u­n¥H²³æªº¼Æ¾Çºâ¦¡§Y¥i±o¤§¡A½Ð°Ñ¦Ò¤W¦Cªí®æ¤¤ªº±Ô­z¡C

¸õ­¶¿ï¾ÜªºASPµ{¦¡±Ô­z

    ·í§Ú­Ì±N©Ò¦³ªºµo¨¥¸ê®Æ±Ä¥Î©T©wµ§¼Æ¤À­¶ÂsÄýªº¤è¦¡¨ÓÅã¥Ü«á¡A³Ì¦n´£¨Ñ¤@­Ó¸õ­¶³sµ²Åã¥Üªº¥\¯à¡AÅýÂsÄýªÌ¥i¥H¿ï¾Ü§Æ±æÂsÄýªº­¶¦¸¶i¦æÂsÄý¡A¦]¦¹¡A§Ú­Ì¥²¶·¦A¼¶¼g¤@¬q¥i¥H«ü©wÂsÄý­¶¦¸ªºASPµ{¦¡±Ô­z¡G
  1. PageCount= 0
  2. RS.MoveFirst
  3. If Request.QueryString("ToPage")<>"" then
  4. PageCount = cint(Request.QueryString("ToPage"))
  5. End If

  6. If PageCount <=0 then PageCount = 1
  7. If PageCount > TotalPage then PageCount = TotalPage
  8. RS.Move (PageCount-1) * 10
½Æ»s¥N½X
¦b³o¬q«ü©wÂsÄý­¶¦¸ªºASPµ{¦¡±Ô­z¤¤¡A§Ú­Ì¨Ï¥Î¤FRecordsetª«¥óªº¡yMove¡z¤èªk¨Ó²¾°Ê¸ê®Æ®w¤¤¸ê®Æ¿ýªº¦s¨ú¦ì¸m¡C
11-13.png

Åã¥Ü¸õ­¶¿ï¾Üªºµ{¦¡±Ô­z

    §¹¦¨²¾°Ê¸ê®Æ®w¤¤¸ê®Æ¿ý¦s¨ú¦ì¸mªºAspµ{¦¡±Ô­z«á¡A±µ¤U¨Ó§Ú­Ì­n§@ªº´N¬O±N³o¨Ç¸õ­¶¿ï¾Üªº³sµ²¸ê®ÆÅã¥Ü¦bºô­¶¤¤¡G

11-14.png

    ¦bºô­¶¤¤¥X²{ªº¸õ­¶¿ï¾Ü¦Cªí¡AÂsÄýªÌ¥¿¶i¦æÂsÄýªº­¶¦¸±N¤£·|¦³¸õ­¶¿ï¾Üªº¶W³sµ²¥\¯à¡I«DÂsÄý¤¤ªº­¶¦¸¤~¨ã¦³¸õ­¶¿ï¾Üªº¶W³sµ²¥\¯à¡I­n¦³³o¼Ëªº¥\¯à¡A§Ú­Ì«h¥i¯S¹L¤U¦C³o¬qASPµ{¦¡±Ô­z¨Ó¹F¦¨¡C
  1. <%
  2. for i=1 to TotalPage
  3. If i<>PageCount then
  4. Response.Write "<font color=black>¡U</font>
  5. <a href=guest.asp?topage="& i &"><font color=#cb55cc>" & i & "</font></a><font color=black>¡U</font>"
  6. else
  7. Response.Write "<font color=black>¡U</font>
  8. <font color=#000000>"&i&"</font><font color=black>¡U</font>"
  9. end if
  10. next
  11. %>
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

        ÀR«ä¦Û¦b : ¥¬¬I¦p¼½ºØ¡A¥HÅw³ß¤ß´þ¼íºØ¤l¡A¤~·|µoªÞ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD