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

[±Ð¾Ç] (¹ê¾Ô±MÃD) ±Ð¾­û±M°Ï ½u¤W·s¼W¨Ï¥ÎªÌ½g

[±Ð¾Ç] (¹ê¾Ô±MÃD) ±Ð¾­û±M°Ï ½u¤W·s¼W¨Ï¥ÎªÌ½g

Ãö©ó«Ø¥ß¤@­Ó¡y±Ð¾­û±M°Ï¡z¡A§Ú­Ì¤§«e¤w¸g¤¶²Ð¹L¸Ó¦p¦ó±Nºô­¶Âê½X¡AµM«á¸g¥Ñ¶i¦æ¡yµn¤J(Login)¡zªº°Ê§@¡A½T»{¨­¤À¬°®Õ¤º±Ð¾­û«á¤~±Nºô­¶¸Ñ°£Âê½X¡F¦P®É¡A§Ú­Ì¤]¸Ñ»¡¤F¦p¦ó±NAccess¸ê®Æ®wÀÉ®×½s½X»P¥[±K¡I¦ý¬O¡A¹ï©ó±Ð¾­û¨­¤À½T»{ªº¸ê®Æ®wÀɮקڭ̸Ӧp¦ó¶i¦æºûÅ@©O¡H

¡@¹ï©ó±Ð¾­û¨­¤À½T»{ªº¸ê®Æ®wºûÅ@¤è¦¡¦³¨âºØ¡G¤@¬O¥Ñ­t³d¾Ç®Õºô¯¸³]¸mªº±Ð®v¨Ó­t³d¡A·íµM³oºØ¤è¦¡¬O³Ì«OÀIªº¡A¦]¬°¥Ñ­t³d¾Ç®Õºô¯¸³]¸mªº±Ð®v¨Ó¶i¦æ¸ê®Æ®wªººÞ²z¥i°w¹ï¨C­Ó±Ð¾­ûªº¨­¤À¶i¦æ½T»{ªº¤u§@¡A¤£¹L³o¼Ë°µ­t³d¾Ç®Õºô¯¸³]¸mªº±Ð®v¥i¯à·|«Ü²Ö¡I¥t¥~¤@ºØ¤è¦¡´N¬O¥Ñ±Ð¾­û­Ì¦Û¤v¨Óµn¿ý­Ó¤H¸ê®Æ¡A¦p¦¹¤@¨Ó¡A­t³d¾Ç®Õºô¯¸³]¸mªº±Ð®v´N¤£¤£¥Î¨¯­Wªº¥´¶}¸ê®Æ®w¤@µ§¤@µ§ªº¿é¤J¸ê®Æ¤F¡C

½u¤W·s¼Wªºµ{¦¡¾÷¨î

¦p¦ó«Ø¥ß½u¤W·s¼W±Ð¾­ûªº¾÷¨î¡H§Ú­Ì¤w¸g¾Ç²ß¹L¤FACCESS¸ê®Æ®wÀɮתº½s½X»P¥[±K¡AÁÙ°O±o§Ú­Ì¤W¦¸½s½X¥[±K¹Lªº±Ð¾­û¨­¤À½T»{¸ê®Æ®wÀÉ®×¥s¤°»ò¦WºÙ¶Ü¡H­n¶}±Ò¥[±Kªº¸ê®Æ®w¸Ó¦p¦ó³B²z©O¡H¸Ó¦p¦óÅçÃÒªí³æ¤¤ªºÄæ¦ì¦³¨S¦³¿é¤J¸ê®Æ©O¡H·s¼Wªº³¡¤À½Ð±z¾Ç²ß¡I¤w¸g¤¶²Ð¹Lªº³¡¤À½Ð±z½Æ²ßËç¡C


  • ­º¥ý¡A­nÅý³s½uªº±Ð¾­û½u¤W·s¼W¦Û¤vªº¸ê®Æ¡A§Ú­Ì·íµM±o¥ý³]­p¤@­Ó¥i¥HÅý±Ð¾­û­Ì¶ñ¼g­Ó¤H¸ê®Æªºªí³æ¹Æ¡I¦b¥»¨Ò¤¤§Ú­Ì±N³o­Ó¡y½u¤W·s¼W±Ð¾­û¡zªºªí³æºô­¶ÀɮצWºÙ©w¬°¡G¡yadduser.htm¡z¡C

  • ·í³s½uªº±Ð¾­û©ó¡y½u¤W·s¼W±Ð¾­ûªí³æ¡z¤¤¶ñ¼g¦n¬ÛÃö¸ê®Æ¡A«ö¤U¡y½u¤W·s¼W¡z«ö¶s¤§«á¡A³o¨Ç¶ñ¼g¦nªº¸ê®Æ±N¥æ¥Ñ¬ö¿ý¥H¤Î³B²z·s¼W±Ð¾­û¸ê®ÆªºASPµ{¦¡¨Ó¼g¤J¸ê®Æ®w¡A³o­Ó¬ö¿ý¥H¤Î³B²z·s¼W±Ð¾­û¸ê®ÆªºASPµ{¦¡ºô­¶Àɮקڭ̱N¥¦©w¦W¬°¡G¡yaddin.asp¡z¡A¦¹ASPµ{¦¡¤£¶È­n±N·s¼Wªº±Ð¾­û¸ê®Æ¼g¤J¸ê®Æ®w¡A¦P®ÉÁÙ¥²¶·ÅçÃÒ³s½uªº±Ð¾­û¦b¡y½u¤W·s¼W±Ð¾­ûªí³æ¡z¤¤¦U­ÓÄæ¦ì¤¤¬O§_³£¦³¶ñ¼g¸ê®Æ¡C

  • ³Ì«á¡AÁÙ¦³¤@­Ó¥²­nªºÀÉ®×¥²¶·³Q«Ø¥ß¡A¨º´N¬O¡y±Ð¾­û¨­¤À½T»{¡zªº¸ê®Æ®wÀɮסA³o­ÓÀÉ®×­t³d¦s©ñ·s¼Wªº±Ð¾­û¸ê®Æ¡A¦b¥»½d¨Ò¤¤³o­Ó¬ö¿ý·s¼Wªº±Ð¾­û¸ê®Æ®wÀɮ׬O¸g¹L¥[±K½s½Xªº³á¡I§Ú­Ì±N¥¦©w¦W¬°¡G¡ynewteach.mdb¡z¡C

¤U¹Ï¬°½u¤W·s¼W±Ð¾­ûªº²Õ¦¨»PÃöÁp©Ê»¡©ú¹Ï¡G
13-8.png
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

½u¤W·s¼W±Ð¾­ûªí³æºô­¶

·í§Ú­Ì­n¦bºô­¶¤¤´£¨Ñ¤@­Ó¥i¥HÅý³s½uªº±Ð¾­û¶ñ¼g¸ê®Æªº¸ê®ÆÄæ¦ì°Ï°ì¡A§Ú­Ì¥²¶·³]­p¤@­Ó¡y½u¤W·s¼W±Ð¾­ûªí³æ¡z¡AÅý³s½uªº±Ð¾­û¥i¥H¦b¤W­±¶ñ¼g­Ó¤H¸ê®Æ¡A¨Ã¥B­n¯à±N³o¨Ç­Ó¤H¸ê®Æ¸ê®Æ°eµ¹§Ú­Ì³B²z·s¼W±Ð¾­û¸ê®ÆªºASPµ{¦¡¡yaddin.asp¡z¨Ó¬ö¿ý¥H¤Î³B²z³o¨Ç±Ð¾­û¸ê®Æ¡C

±N²{¦b§Ú­Ì´N¨Ó»s§@¤@­Ó¥i¥HÅý¥i¥HÅý³s½uªº±Ð¾­û¶ñ¼g¸ê®Æªºªí³æºô­¶¡yadduser.htm¡z¡G

13-9.png

½s¸¹

Äæ¦ì

Äæ¦ì¦WºÙ

ªí³æ¤¸¥ó

¢°

´L©m¤j¦W

Name

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

¢±

¾ºÙ

Job

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

¢²

µn¤J¦WºÙ

ID

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

¢³

µn¤J±K½X

Password

±K½XÄæ¦ì

¢´

½u¤W·s¼W

Submit

«ö¶s




¡y´L©m¤j¦W¡zºô­¶±Ô­z¼ÐÅÒ
  1. <input type="text" name="Name" size="20">
½Æ»s¥N½X
¡y¾ºÙ¡zºô­¶±Ô­z¼ÐÅÒ
  1. <input type="text" name="Job" size="20" >
½Æ»s¥N½X
¡yµn¤J¦WºÙ¡zºô­¶±Ô­z¼ÐÅÒ
  1. <input type="text" name="ID" size="20">
½Æ»s¥N½X
¡yµn¤J±K½X¡zºô­¶±Ô­z¼ÐÅÒ
  1. <input type="password" name="Password" size="20">
½Æ»s¥N½X
½Ð¯S§Oª`·N¡Gªí³æ¤º®e¸ê®Æªº¶Ç°e¤è¦¡§Ú­Ì³]©w¬°¡yPost¡z¡A¦Ó¥B·í³o¨Ç·N¨£¸ê®Æ³Q°e¹F¨ì IIS/PWS «á¡AIIS/PWS ªººô¸ô¦øªA¾¹ºÝ­t³d³B²z·N¨£¸ê®ÆªºASPµ{¦¡¬O¡yaddin.asp¡z.
  1. <form  method="POST" action="addin.asp">
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

¸ê®ÆÄæ¦ìÅçÃÒ

·í³s½uªº±Ð¾­û©ó¡y½u¤W·s¼W±Ð¾­ûªí³æ¡z¤¤¶ñ¼g¦n¬ÛÃö¸ê®Æ¡A«ö¤U¡y½u¤W·s¼W¡z«ö¶s¤§«á¡A¶ñ¼g¦nªº¸ê®Æ±N¥æ¥Ñ¬ö¿ý¥H¤Î³B²z·s¼W±Ð¾­û¸ê®ÆªºASPµ{¦¡¡yaddin.asp¡z¡A¨Ó¼g¤J¸ê®Æ®wÀɮסA¶ñ¼g¦nªº¸ê®Æ¼g¤J¸ê®Æ®w¤§«e¡A§Ú­Ì¥²¶·¥ýÅçÃÒ³s½uªº±Ð¾­û¦b¡y½u¤W·s¼W±Ð¾­ûªí³æ¡z¤¤¦U­ÓÄæ¦ì¤¤¬O§_³£¦³¶ñ¼g¸ê®Æ¡C

¡@­Y¡y½u¤W·s¼W±Ð¾­ûªí³æ¡z¤¤ªºÄæ¦ì¦³¥¼¶ñ¤J¸ê®Æ¦Ó¯d¥ÕªÌ¡A±N¤£¤©±µ¨ü¡A¤£¦ý¸ê®Æ±N¤£·|¼g¤J¸ê®Æ®wÀɮסA¦Ó¥B±N²£¥Í¤@¬q¿ù»~°T®§ªººô­¶¡A§Ú­Ì¥H¥¼¶ñ¼g±K½XÄæ¦ì¬°¨Ò¡G
¦b½u¤W·s¼W±Ð¾­ûºô­¶¤¤¡A±K½XÄæ¦ì¥¼¶ñ¤J¸ê®Æ¡A¦p¤U¹Ï¡G

13-10.png

«ö¤U½u¤W·s¼W«ö¶s®É±N¥X²{¥X²{¿ù»~°T®§ºô­¶¦p¤U¹Ï¡G

13-11.png

¦b¡y½u¤W·s¼W±Ð¾­ûªí³æ¡z¤¤¦@¦³¥|­ÓÄæ¦ì¥²¶·¸ê®ÆÅçÃÒ¡A¤À§O¬OName(´L©m¤j¦W)¡BJob(¾ºÙ)¡BID(µn¤J¦WºÙ)»PPassword(µn¤J±K½X)µ¥¥|­ÓÄæ¦ì¡A·í§Ú­Ìªº¬ö¿ý¥H¤Î³B²z·s¼W±Ð¾­û¸ê®ÆASPµ{¦¡addin.asp¡A±µ¦¬¨ì¨Ó¦Û¡y½u¤W·s¼W±Ð¾­ûªí³æ¡zªºÄæ¦ì¸ê®Æ«á¡A¥u­n³z¹L¡yIF¡z§PÂ_±Ô­z¨ÓÅçÃÒÄæ¦ì¸ê®Æ¤º®e¬O§_¬°¡yEmpty¡z´N¥iª¾¹D¸ê®ÆÄæ¦ì¤º®e¬O§_¯d¥Õ¡A­Y¸ê®ÆÄæ¦ì¤º®e¯d¥Õ«h©I¥s¡ymsg¡z°Æµ{¦¡¨Ó²£¥Í¤@­Ó¿ù»~°T®§ªººô­¶¡G

³z¹L¥|­Ó¡yIF¡z§PÂ_±Ô­z¨ÓÅçÃÒÄæ¦ì¸ê®Æ¤º®e¬O§_¬°¡yEmpty¡z¡A­Y¸ê®ÆÄæ¦ì¯d¥Õ´N©I¥s¡ymsg¡z°Æµ{¦¡¡A¦P®É¶Çµ¹¡ymsg¡z°Æµ{¦¡¤@­Ó¿ù»~°T®§¦r¦ê°Ñ¼Æ¡C

13-12.png

·í¡yIF¡z§PÂ_±Ô­zÅçÃÒÄæ¦ì¸ê®Æ¤º®e¬O§_¬°¡yEmpty¡z¡A¤]´N¬O»¡¸ê®ÆÄæ¦ì¤º®e¬O§_¯d¥Õ®É¡A«h©I¥s¡ymsg¡z°Æµ{¦¡¨Ó²£¥Í¤@­Ó¿ù»~°T®§ªººô­¶¡A¡ymsg¡z°Æµ{¦¡«D±`²µu¡A¤£¹L¡A©I¥s¡ymsg¡z°Æµ{¦¡ªº¦P®É¡A¥²¶·¶Çµ¹¡ymsg¡z°Æµ{¦¡¤@­Ó¿ù»~°T®§¦r¦ê°Ñ¼Æ¡A³o­Ó¿ù»~°T®§¦r¦ê°Ñ¼Æ±NÅã¥Ü¦b¿ù»~°T®§ªººô­¶¤¤:

13-13.png

³Ì«á¡A§Ú­Ì¨Ó¬Ý¬Ý¡ymsg¡z°Æµ{¦¡¬O¦p¦ó¨Ó²£¥Í¤@­Ó¿ù»~°T®§ªººô­¶¡G

13-14.png

·í¡ymsg¡z°Æµ{¦¡³Q©I¥s®É±N¡A¿é¥X¤@¬qºô­¶html±Ô­z(¤W¹Ïºñ¦â³¡¤Àªº°Ï¬q)¡A¦P®É±N¡yIF¡z§PÂ_±Ô­z©I¥s¡ymsg¡z°Æµ{¦¡©Ò¶Ç¨Óªº¿ù»~°T®§¦r¦ê°Ñ¼Æ¤º®e(info)¡A¥[¨ìºô­¶html±Ô­z¤¤Åã¥Ü¥X¨Ó¡A¦P®É°õ¦æ¡yResponse.End¡z±Ô­z²×¤îµ{¦¡ªº°õ¦æ¡C
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

Âê½X¸ê®Æ®w¦s¨ú

¦b§¹¦¨Äæ¦ì¸ê®Æ¤º®eÅçÃÒ«á¡A­Y¡y½u¤W·s¼W±Ð¾­ûªí³æ¡z¦U­ÓÄæ¦ì¤¤³£¦³¿é¤J¸ê®Æ¡A«h§Ú­Ì´N­n¶}±Ò¸ê®Æ®wÀɮרӷs¼W¸ê®Æ¡A¦ý¬O¡A½Ð¤£­n§Ñ°O§Ú­Ìªº¸ê®Æ®w¥i¬O¤@­Ó­Ó³]©w±K½X¤WÂꪺ¸ê®Æ®wÀɮ׳á¡A©Ò¥H§Ú­ÌÁÙ¥²¶·¦bConnectionª«¥óªºOpen¤èªk¤¤¦A¼W¥[¤@­Ó¡yPwd¡zªº°Ñ¼Æ¡G

13-15.png

¡yPwd=1234¡z´N¬O¥Nªí¦b³sµ²¶}±Ò¸ê®Æ®w®É¦P®É¶Ç°e¥X¤@²Õ±K½X¡y1234¡z¡A´N¦p¦P¥ÎAccess¶}±Ò¤WÂꪺ¸ê®Æ®wÀɮ׮ɩó¡y»Ý­n±K½X¡zªº¹ï¸Üµøµ¡¤¤¶ñ¤J±K½X¬O¬Û¦Pªº·N«ä¡C

½Ðª`·N¡G±K½X¡y1234¡z¬O¤p»x¦Û¤vªºËç!!¥i¤£¬O¼Ð·Çµª®×°Ú¡I¦]¬°¥»½d¨Ò¤¤ªº¸ê®Æ®wÀɮסynewteach.mdb¡zÂê½Xªº±K½X³]©w¬O¡y1234¡z¡A©Ò¥H¡yPwd¡z°Ñ¼Æªº±K½X­Èµ¥©ó¡y1234¡z¡I
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

³B²zµn¿ý¸ê®Æ
²×©ó¨Ó¨ì§Ú­Ì¡yaddin.asp¡zµ{¦¡¼¶¼gªº³Ì«á¶¥¬q¡A§Ú­Ì¦bÅçÃÒ¡y½u¤W·s¼W±Ð¾­ûªí³æ¡z¤¤ªºÄæ¦ì¸ê®Æ¡A³£¦³¶ñ¼g¤Î¶¶§Qªº¶}±Ò±K½X¥[Âꪺ¸ê®Æ®wÀɮ׫á¡A«h±µ¤U¨Ó´N¬O­n±N±µ¦¬¦Û¡y½u¤W·s¼W±Ð¾­ûªí³æ¡z¤¤ªºÄæ¦ì¸ê®Æ¼g¤J¸ê®Æ®wÀɮפ¤¡A¦p¤U¹Ï©Ò¥Ü¡G

13-16.png

chgStr¨ç¼Æªº¨Ï¥Î
chgStr¨ç¼Æ¬O¥Î¨Ó±NÄæ¦ì¸ê®Æ¤¤§t¦³³æ¤Þ¸¹ªº¸ê®ÆÂà´«¬°Âù¤Þ¸¹¡AÁקKÄæ¦ì¸ê®Æ¤¤¤J¦³³æ¤Þ¸¹¸ê®Æ®É¡A¦b»PInsert Into«ü¥O²Õ¦X®É²£¥Í¿ù»~¡C


addin.asp
  1. <%
  2. '±µ¦¬¨Ó¦Û¡y½u¤W·s¼W±Ð¾­ûªí³æ¡z¤¤ªºÄæ¦ì¸ê®Æ
  3. name=Request("Name")
  4. job = Request("Job")
  5. id=Request("ID")
  6. password = Request("Password")
  7. '§PÂ_Äæ¦ì¸ê®Æ¬O§_¬°ªÅ¥Õ
  8. '­YÄæ¦ì¸ê®ÆªÅ¥Õ«h©I¥smsg°Æµ{¦¡
  9. If name=Empty Then msg "±z§Ñ°O¿é¤J¤j¦W°Õ!!"
  10. If job=Empty Then msg "±z§Ñ°O¿é¤J¾ºÙ°Õ!!"
  11. If id=Empty Then msg "±z§Ñ°O¶ñ¼gµn¤J¦WºÙ°Õ!!"
  12. If password=Empty Then msg "±z§Ñ°O¶ñ¼gµn¤J±K½X°Õ!!"

  13.         Set CN = Server.CreateObject("ADODB.Connection")
  14.         DBPath = Server.MapPath("newteach.mdb")
  15.         CN.Open "Driver={Microsoft Access Driver (*.mdb)};pwd=1234;DBQ="&DBPath
  16.          
  17. Function chgStr( data )
  18.    chgStr = "'" & Replace( data, "'", "''" ) & "'"
  19. End Function

  20. sql = "Insert Into ±Ð¾­û»{ÃÒ (ID, Password, Name, Job) Values ("
  21. sql = sql & chgStr(id) & ", "
  22. sql = sql & chgStr(password) & ", "
  23. sql = sql & chgStr(name) & ", "
  24. sql = sql & chgStr(job) & ")"
  25. msg "½u¤W·s¼W±Ð¾­û¦¨¥\!!"
  26. %>

  27. <%
  28. Sub msg( info )
  29. %>
  30.    <CENTER>
  31.    <H2><Font Color=red><%=info%><HR size="1" color="#FF0066">
  32.    <FORM><INPUT Type=Button Value="¤W¤@­¶" OnClick="history.back();">
  33.    </FORM>
  34.    </CENTER>
  35. <%
  36.    Response.End
  37. End Sub
  38. %>
½Æ»s¥N½X
(¹ê¾Ô±MÃD) ±Ð¾­û±M°Ï ½u¤W·s¼W¨Ï¥ÎªÌ½g §¹¾ã½d¨ÒÀ£ÁYÀÉ: addnew.zip (117.06 KB)
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

        ÀR«ä¦Û¦b : ¬Ý§O¤H¤£¶¶²´¡A¬O¦Û¤v­×¾i¤£°÷¡C
ªð¦^¦Cªí ¤W¤@¥DÃD