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

[±Ð¾Ç] (¹ê¾Ô±MÃD) ±Ð¾­û±M°Ï ­­¨îÂsÄý½g

[±Ð¾Ç] (¹ê¾Ô±MÃD) ±Ð¾­û±M°Ï ­­¨îÂsÄý½g

«Ø¥ß¾Ç®Õ±MÄݪººô¯¸¡A¤£¥~¥G¬O§Æ±æªÀ·|¤j²³¤Î®aªø¤F¸Ñ¾Ç®Õªº¯S¦â»PÀuÂI¡A¶i¦Ó»P®aªø­Ì¤¬°Ê¡C ¦ý¬O¹ï©ó®Õ¤º±Ð°È¡A¤£¤@©w»Ý­n¦V¤j²³¤Î®aªø­Ì¤½§G¡C¤ñ¦p»¡¡G±Ð¾­û¾°È¤Wªº½Õ°Ê¡B±Ð®vªºµûŲµ¥µ¥¡D¡D¡D©Ò¥H¦b¦¹§Ú­Ì¥u­n«Ø¥ß¤@­Ó¡y±Ð¾­û±M°Ï¡z´N¦æ¤F¡A¦pªG¬O¦V®Õ¤º±Ð¾­û¤½§G®ø®§ªººô­¶¡A§Ú­Ì´N¥ý­n¨D¶i¦æ¡yµn¤J(Login)¡zªº°Ê§@¡A½T»{¨­¤À¬°®Õ¤º±Ð¾­û«á¡A¤~¥i¥H¶i¦æºô­¶ªºÂsÄý¡C

«Ø¥ß±Ð¾­û±M°Ï³Ì­«­nªº´N¬O±Ð¾­û¨­¥÷ªº½T»{¡A§Ú­Ì­n¥ý½T»{¨Ó³XªÌªº¨­¤À¬O§_½T¹ê¬O®Õ¤º±Ð¾­û¡A¦]¦¹¡I§Ú­Ì¥²¶·³z¹L¨­¤ÀÅçÃÒªº¾÷¨î¨ÓÅý±Ð¾­û¡yµn¤J¡z¡C


  • ­º¥ý§Ú­Ì¥ý¨Ó·Q·Q¡G¦V®Õ¤º±Ð¾­û¤½§G®ø®§ªººô­¶¦³¦h¤Ö¡H¦pªG¬O¤Ö¶qªº¤T¤­­¶¡A§Ú­Ì¥i¥H¦b¨C±iºô­¶¤¤¥[¤J¡y¨­¤À»{ÃÒ¡zªº¥\¯à¡A¦P®É¡A®Õ¤º±Ð¾­û¨C³sµ²ÂsÄý¤@±iºô­¶´N¥²¶·¨­¤À»{ÃÒ¤@¦¸¡A¦pªG¬O¤Ö¶qªº¤T¤­­¶¡A¨º¥u¬O¦hµn¤J´X¦¸¦Ó¤w¡A¦ý¦pªG¬O¤Q¼Æ­¶©Î¬O¼Æ¤Q­¶©O¡H¨º¤£¶È¬O­t³dºô¯¸«Øºcªº¦Ñ®v²Ö(¨C±iºô­¶³£±o¥[¤W¨­¤À»{ÃÒµ{¦¡)¡A³s¶i¦æ³sµ²ÂsÄýªº±Ð¾­û³£³Â·Ð(­n¤£Â_ªº¶i¦æµn¤J½T»{¨­¥÷ªº°Ê§@)¡A©Ò¥H§Ú­Ì¥²¶·±N¡y¨­¤À»{ÃÒ¡zªºµ{¦¡¿W¥ß¥X¨Ó¡C

  • ¡y¨­¤À»{ÃÒ¡zªº¥\¯à­nµo´§®Ä¥Î¡A·íµM­n¦³¤ñ¹ï¨­¥÷ªº¸ê®Æ¨Ó·½¡A©Ò¥H§Ú­Ì¥²¶·«Ø¥ß¤@­Ó¡y±Ð¾­û¨­¥÷¡zªº¸ê®Æ®w¡A§â®Õ¤º±Ð¾­ûªº¸ê®Æ«Ø¥ß©ó¸ê®Æ®w¤¤¥H«K¡y¨­¤À»{ÃÒ¡z®É¯à°÷¶i¦æ¨­¤À½T»{¡C

  • ¥»½d¨Ò¤¤ªºµ{¦¡¡A¬°¤FÅý³\¦h­t³d¾Ç®Õºô¯¸«Øºcªº±Ð®v­Ì¥i¥ß§Y¨Ï¥Î¡A©Ò¥Hµ{¦¡½Xªº³¡¤À±N¼È®É¤£¦h§@»¡©ú¡A§Ú­Ì±N°w¹ï±Ð¾­û¨­¤À¸ê®Æ«Øºcªº¸ê®Æ®w¸ê®Æªí¤º®e³]©w¤Îµ{¦¡§Q¥Îªº³¡¤À§@»¡©ú¡C




«Ø¥ß±Ð¾­û¸ê®Æ


   ¬°¤FÅý¡y¨­¥÷»{ÃÒ¡zªº¥\¯àµo´§®Ä¥Î¡A©Ò¥H§Ú­Ì¥²¶·¥ý«Ø¥ß¤ñ¹ï¨­¥÷ªº¸ê®Æ¨Ó·½¡G¡y±Ð¾­û¨­¥÷¡z¸ê®Æ®w¡A§â®Õ¤º±Ð¾­ûªº¨­¤À¸ê®Æ«Ø¥ß©ó¸ê®Æ®w¤¤¥H«K¡y¨­¥÷»{ÃÒ¡z®É¯à°÷¶i¦æ¨­¤À½T»{¡C

¥»½d¨Ò±N®Õ¤º±Ð¾­ûªº¨­¤À¸ê®Æ«Ø¥ß©óAccess¸ê®Æ®w¤¤¡A³o­Ó¡y±Ð¾­û¨­¥÷¡z¸ê®Æ®w§Ú­Ì©w¦W¬°¡yteach.mdb¡z¡A¦Ó¦b¸ê®Æ®w¤¤¥Î¨ÓÀx¦s±Ð¾­û¨­¤À¸ê®Æªº¸ê®Æªí«h©w¦W¬°¡y±Ð¾­û»{ÃÒ¡z¡C

¦b¡y±Ð¾­û»{ÃÒ¡z¸ê®Æªí¤¤¡A§Ú­Ì«Ø¥ß¤F¥|­ÓÄæ¦ì¡GID¡BPassword¡BName¡BJob¡A¨äÄæ¦ì³]©w»¡©ú¦p¤U¡G

Äæ¦ì¦WºÙ

¸ê®Æ«¬ºA

»¡©ú

ID

¤å¦r

µn¤J®Éªº¨Ï¥Î¦WºÙ

Password

¤å¦r

µn¤J±K½X

Name

¤å¦r

±Ð¾­û©m¦W

Job

¤å¦r

±Ð¾­û¾ºÙ



13-1.png

13-2.png
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

«Ø¥ßµn¤Jµ{¦¡

¬°¤FÁקK­«½Æµn¤Jªº°Ê§@¡A¥H¤Î§K°£±N¨C­Óºô­¶¥[¤J¨­¤À»{ÃÒªºµ{¦¡¡A©Ò¥H§Ú­Ì¥²¶·¥ý«Ø¥ß¤@­Ó½T»{µn¤Jªºµ{¦¡¡G¡ycheck.asp ¡z

³o­Óµn¤Jµ{¦¡¥²¶·¨ã³Æ¤U¦C¥|¶µ°ò¥»¥\¯à¡G


  • ­Y³sµ²ÂsÄýªÌ­n³sµ²±Ð¾­û±MÄݪººô­¶¡A¦ý¬O©|¥¼³q¹L¨­¤À½T»{¡A¤]´N¬O»¡©|¥¼§¹¦¨µn¤Jªº°Ê§@¡A«hÅã¥Ü¦p¤U¹Ïªºµn¤J¤Æµe­±¡G

    13-3.png

  • ¶i¦æ³sµ²ÂsÄýªÌªº±Ð¾­û¨­¤À½T»{¡C

  • ¦pªG³sµ²ÂsÄýªÌªº¨­¤À¤w¸g½T»{¬°±Ð¾­ûµL»~¡A´Nµ¹¤©³sµ²ÂsÄý±Ð¾­û±MÄݺô­¶ªºÅv§Q¡C

  • §PÂ_³sµ²ÂsÄýªÌ¬O§_¤w¸g§¹¦¨¹Lµn¤J¨­¤À½T»{ªº°Ê§@¡A¦pªG¤w¸g°µ¹Lµn¤J°Ê§@¥B¨­¤À½T»{µL»~¡A´N¤£»Ý¦AÅã¥Üµn¿ýµe­±¤Îµn¤J­n¨D¡C



µn¤Jµe­±

§Ú­Ìµn¤Jµ{¦¡¦b§PÂ_³sµ²ÂsÄýªÌ©|¥¼³q¹L¨­¤À½T»{¡A¤]´N¬O»¡©|¥¼§¹¦¨µn¤Jªº°Ê§@®É¡A¥²¶·¥ß§YÅã¥Ü¥Xµn¤Jªºµe­±¡A¦]¦¹¡A§Ú­Ì¥²¶·¥ý§¹¦¨µn¿ýµe­±³¡¤ÀªºHTMLºô­¶¤º®e¡A°ò¦ºô­¶HTML¦p¤U¡G
  1. <HTML>
  2. <BODY>
  3. <h2 ALIGN="CENTER"><img border="0" src="login.gif"></h2>
  4. <CENTER><FORM Action=<%=Request.ServerVariables("PATH_INFO")%> Method=POST>
  5. <TABLE BORDER=1 CELLSPACING=0 >
  6. <TR><TD ALIGN=RIGHT>µn¤J¦WºÙ:</TD>
  7. <TD><Input Type=Text Name=ID Size=12></TD></TR>
  8. <TR><TD ALIGN=RIGHT>µn¤J±K½X:</TD>
  9. <TD><Input Type=Password Name=Password Size=8></TD></TR>
  10. </TABLE><P>
  11. <INPUT Type=Submit Name="Send" Value=" ½T ©w ">
  12. </FORM></CENTER>
  13. </BODY>
  14. </HTML>
½Æ»s¥N½X
13-4.png


¨­¤ÀÅçÃÒµ{¦¡

§¹¦¨°ò¦ªºµn¿ýµe­±HTML³]­p¡A±µ¤U¨Ó´N¬Oµn¤J½T»{µ{¦¡ªº¼¶¼g¤F¡A¦bµ{¦¡¤¤§Ú­Ì¬O§Q¥ÎSessionª«¥ó¨Ó°O¿ý³sµ²ÂsÄýªÌ¬O§_¤w¸g§¹¦¨¹Lµn¤J¨­¤À½T»{ªº°Ê§@¡A¦pªG¤w¸g°µ¹Lµn¤J°Ê§@¥B¨­¤À½T»{µL»~¡A´N¤£»Ý¦AÅã¥Üµn¿ýµe­±¤Îµn¤J­n¨D¡C¦pªG³sµ²ÂsÄýªÌªº¨­¤À©|¥¼½T»{¡A«h¥X²{µn¤Jªí³æÅý³sµ²ÂsÄýªÌ¿é¤Jµn¤J¸ê®Æ¡A·í³sµ²ÂsÄýªÌ¦bªí³æ¤¤¿é¤J¸ê®Æ«á¡A«ö¤U¡y½T©w¡z«ö¶s±N·|°õ¦æ§Ú­Ìªº¨­¤À½T»{µ{¦¡¶i¦æ¶}±Ò¸ê®Æ®w¡A¨Ó½T»{³sµ²ÂsÄýªÌªº¨­¤À¡I¤U¦C´N¬O§Ú­Ì¨­¤À½T»{ªºASPµ{¦¡¡G
  1. <%
  2. ID=Request("ID")
  3. Password = Request("Password")
  4. ok=session("checkok")
  5. IF ok <> "yes" Then
  6. Set conobject = Server.CreateObject("ADODB.Connection")
  7. DBPath = Server.MapPath("teach.mdb")
  8. conobject.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ="&DBPath
  9. Set recobject=Server.CreateObject("ADODB.Recordset")
  10. SQL = "Select * From ±Ð¾­û»{ÃÒ Where ID='" & ID & "'"
  11. SQL = SQL & " And Password = '" & Password & "'"
  12. recobject.Open SQL,conobject,1,1,1
  13. if Not recobject.Eof then
  14. ok = "yes"
  15. session("checkok")=ok
  16. else
  17. %>
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

¥[¤JÅçÃÒµ{¦¡

13-5.png

¨ì²{¶¥¬q¡A§Ú­Ì¤w¸g§¹¦¨¡y¨­¤À½T»{¡zºô­¶ªº¡yµn¤Jªí³æ¡z»P¡y¨­¤ÀÅçÃÒ¡zªºASPµ{¦¡¼¶¼g¡C²{¦b§Ú­Ì±µµÛ¨Ó¬Ý¬Ý¸Ó¦p¦ó±N¤@¯ëªººô­¶³]©w¬°±Ð¾­û±MÄݪººô­¶¡C

    ²{¦b´N¥H½d¨Ò©Ò¨Ï¥ÎªºTEST1.asp»PTEST2.asp¬°¨Ò¦V¤j®a»¡©ú¡A­n±N¤@¯ëªººô­¶³]©w¬°±Ð¾­û±MÄݪººô­¶¡A¨ä¹ê¥u­n¦b¨C­Óºô­¶¤¤¥[¤J¨­¤ÀÅçÃÒªºµ{¦¡§Y¥i¡A¦ý¬O¤£­n§Ñ¤F¡I§Ú­Ì¤w¸g±N¨­¤ÀÅçÃÒªºASPµ{¦¡»Pµn¤Jµe­±¿W¥ß¥X¨Ó¤F¡A¦]¦¹¡A¤£»Ý­n±N¨C­Ó­n³]©w¬°±Ð¾­û±MÄݪººô­¶³£¥[¤W¬Û¦Pªºµ{¦¡¡A§Ú­Ì¥u»Ý­n¦b¨C­Óºô­¶ªº³Ì«e­±¦ì¸m¥[¤J¤U­±³o¦æ±Ô­z´N¦æ¤F¡G
  1. <!-- #Include File="check.asp" -->
½Æ»s¥N½X
§Q¥Î»¡©ú

     ¥»½d¨Ò¤¤©Ò´£¨Ñªº¨­¤ÀÅçÃÒµ{¦¡¡ycheck.asp¡z¡A±N®Õ¤º±Ð¾­ûªº¨­¤À¸ê®Æ«Ø¥ß©óAccess¸ê®Æ®w¤¤¡A³o­Ó¡y±Ð¾­û¨­¥÷¡z¸ê®Æ®w¬°¡yteach.mdb¡z¡A¦P®É¦b¸ê®Æ®wÀɮפ¤¥Î¨ÓÀx¦s±Ð¾­û¨­¤À¸ê®Æªº¸ê®Æªí¬°¡y±Ð¾­û»{ÃÒ¡z¸ê®Æªí¡C

    ±z¥i¥H¥ý¸Õ¸Õ§Ú­Ìªº½d¨Òºô­¶TEST1.asp©Î¬OTEST2.asp¡A¤£ºÞ±z¥ý³sµ²¶i¤J­þ¤@­Óºô­¶¡A³£¥²¶·¥ý¶i¦æ¨­¤À½T»{ªºµn¤J°Ê§@¡A¦ý¬O¥u­n½T»{¤@¦¸§Y¥i¡A¦pªG¦A¶i¦æ¨ä¥Lªº±MÄݺô­¶³sµ²®É´N¤£¥²¦A¶i¦æ¥ô¦óªº¨­¤À½T»{µn¤J°Ê§@¤F¡A´ú¸Õµn¤J¦WºÙ¡GTEST¡A±K½X¡G1234¡A¥H³sµ²TEST2.asp¬°¨Ò¡A²Ä¤@¦¸³sµ²ÂsÄý®É±N¨£¨ì¤U¦Cªºµn¤Jµe­±¡A½Ð©óµn¤J¦WºÙÄæ¦ì¤¤¶ñ¤J"TEST"¡Aµn¤J±K½XÄæ¦ì¤¤¶ñ¤J"1234"¡G

13-6.png

    ¶¶§Q³q¹L¨­¤À½T»{«á¡A§Y¥i¨£¨ì±MÄݺô­¶TEST2.asp¤º®eµe­±¡G

13-7.png

check.asp
  1. <%
  2. ID=Request("ID")  
  3. Password = Request("Password")
  4. ok=session("checkok")
  5. IF ok <> "yes" Then
  6.         Set conobject = Server.CreateObject("ADODB.Connection")
  7.         DBPath = Server.MapPath("teach.mdb")
  8.         conobject.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ="&DBPath
  9.         Set recobject=Server.CreateObject("ADODB.Recordset")
  10.         SQL = "Select * From ±Ð¾­û»{ÃÒ Where ID='" & ID & "'"
  11.            SQL = SQL & " And Password = '" & Password & "'"
  12.            recobject.Open SQL,conobject,1,1,1
  13.                    if Not recobject.Eof then
  14.                    ok = "yes"
  15.                    session("checkok")=ok
  16.             else
  17.             %>
  18. <HTML>
  19. <BODY>
  20. <h2 ALIGN="CENTER"><img border="0" src="login.gif"></h2>
  21. <CENTER>
  22. <FORM Action=<%=Request.ServerVariables("PATH_INFO")%> Method=post>
  23. <TABLE BORDER=1 CELLSPACING=0 >
  24.    <TR><TD ALIGN=RIGHT>µn¤J¦WºÙ:</TD>
  25.    <TD><Input Type=Text Name=ID Size=10></TD></TR>
  26.    <TR><TD ALIGN=RIGHT>µn¤J±K½X:</TD>
  27.    <TD><Input Type=Password Name=Password Size=8></TD></TR>
  28. </TABLE><P>
  29. <INPUT Type=Submit Value=" ½T ©w ">
  30. </FORM>
  31. </CENTER>
  32. </BODY>
  33. </HTML>
  34. <%
  35. Response.End
  36.             end if   
  37. End If
  38. %>
½Æ»s¥N½X
(¹ê¾Ô±MÃD) ±Ð¾­û±M°Ï ­­¨îÂsÄý½g §¹¾ã½d¨ÒÀ£ÁYÀÉ: password.zip (24.68 KB)
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

        ÀR«ä¦Û¦b : Ãø¦æ¯à¦æ¡AÃø±Ë¯à±Ë¡AÃø¬°¯à¬°¡A¤~¯àª@µØ¦Û§Úªº¤H®æ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD