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

13-1-1 µ{¦¡¼g§@»¡©ú

13-1-1 µ{¦¡¼g§@»¡©ú

13-1-1   µ{¦¡¼g§@»¡©ú¦bindex.htm¶P¥d±H°eºô­¶ªº³¡¤À¦³¨â­Ó­«ÂI¡G

1.ªí³æªº°Ê§@¹ï¶H¡A¤]´N¬O¡uAction¡vÄݩʭȪº«ü©w¡G
  1. <form method=POST action=ecard.php>
½Æ»s¥N½X
¥H¥»¨Ò¨Ó»¡¡A¨Ï¥ÎªÌ¦bindex.htm­¶­±¤¤¶ñ¼g¦n¬ÛÃö¸ê®Æ»P¿ï¾Ü¶P¥d«á¡A«ö¤U¡u±H¥X¶P¥d¡v«ö¶s«á¡Aªí³æ¸ê®Æ­n°e¥æ¡yecard.php¡zµ{¦¡°µ³B²z¡A©Ò¥H¡uAction¡vÄÝ©Ê­È«ü©w¬°¶P¥d³B²zµ{¦¡¡yecard.php¡z¡C


2.¶P¥d¹Ï¤ùªº³]©w¡Aindex.htm­¶­±¤¤©Ò¨£ªº¶P¥d¤p¹Ï¤ù³£¬OÅý±H¥óªÌ°Ñ¦Ò¿ï¾Ü¥Î¡A¯u¥¿¨M©w­n±H¥X­þ±i¶P¥d¹Ï¤ù«h¬O¦b©ó¶P¥d¤p¹Ï¤ù¤W¤èªº¿ï¶µ«ö¶s¡]³æ¿ï«ö¶s Radio¡^¡A³o¨Ç¿ï¶µ«ö¶sªº¦WºÙ¦b¥»¨Ò¤¤³£¥s°µ¡ucard¡v¡A¦ý¬O¦U­Ó¿ï¶µ«ö¶sªºValueÄÝ©Ê­È«o¤£¦P¡A¨ä­È¤À§O¬O¦U¶P¥d¹Ï¤ùªºÀɮצWºÙ¡G
  1.         <td>
  2.                 <input type=radio value=2.jpg name=card checked>
  3.                 <img border=0 src=2.jpg width=180 height=133 align=left>
  4.         </td>
  5.         <td>
  6.                 <input type=radio value=9.jpg name=card>
  7.                 <img border=0 src=9.jpg width=180 height=134 align=left>
  8.         </td>
  9.         <td>
  10.                 <input type=radio value=16.jpg name=card >
  11.                 <img border=0 src=16.jpg width=180 height=134 align=left>
  12. </td>
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

·íindex.htm¤¤ªºªí³æ¸ê®Æ°e¥æ¡yecard.php¡zµ{¦¡®É¡A¥ý¶i¦æ¶l¥óEmailªº¥¿½T©Ê²©öÅçÃÒ¡A¦b¥»¨Ò¤¤¥uÀËÅçEmail¤¤¬O§_§t¦³¡u@¡v²Å¸¹¡A­YµL¡A«h»{©w¨äEmail¤£¥¿½T¡AEmail¤£¥¿½T´N¤£¶i¦æ¶P¥d¶l¥óªº±H°eµ{§Ç¡A¦¹®É·|¥X²{¤@­Ó¡uSorry!! Email¶l¥ó«H½c¶ñ¼g¦³»~³á!!¡vªºJavaScript°T®§µøµ¡¡G

¹Ï13-4  Email¿ù»~¥X²{´£¥Üµøµ¡¡C

«ö¤UJavaScript°T®§µøµ¡¤¤ªº¡u½T©w¡v«ö¶s«á¡A§Y¥i¦^¨ì¤W£¸ºô­¶¡]index.htm¡^µe­±­×¥¿¿é¤Jªº¸ê®Æ¡C
  1. //²©öÅçÃÒ¦¬¥ó»P±H¥ó«H½c¬O§_¥¿½T
  2. If ((!(strpos($fromEmail,'@'))) || (!(strpos($toEmail,'@'))))
  3. {
  4. //Email¤£¥¿½T¥X²{¤@­Ó¿ù»~´£¥ÜªºJavaScript°T®§µøµ¡
  5.       echo "<script>\n";
  6.       echo "alert('Sorry!!Email¶l¥ó«H½c¶ñ¼g¦³»~³á!!');\n";
  7.       echo "window.history.go(-1);\n";
  8.       echo "</script>";
  9. }
½Æ»s¥N½X
­Y¦¬¥ó»P±H¥óªÌªºEmail«H½c³q¹LÅçÃÒ¡A«h¶}©l¶l¥óªº±H¥Xµ{§Ç¡A¦b¥»¨Ò¤¤¬O¨Ï¥ÎCDONTS.NewMail ª«¥ó¨Ó±H°e¶P¥d¶l¥ó¡A©Ò¥H¶P¥d¹Ï¤ù¥H§¨±aªþ¥óªº¤è¦¡¨ÓÀH«H¥ó±H¥X¡ACONDTS.NewMailª«¥óªº¡yAttachFile¡z¤èªk¡G
  1. Mymail.AttachFile(Source [,FileName] [,EncodingMethod])
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

¥H¤U¬°§¹¾ãªºµ{¦¡»Pºô­¶¦Cªí¡G
Index.htm
  1. <html>

  2. <head>
  3. <title>²©ö¹q¤l¶P¥d-¥H§¨±aªþ¥óÀɮתº¤è¦¡±H¥X¶P¥d</title>
  4. </head>

  5. <body background=bg.gif>

  6. <p><font color=#800000 size=4><b>²©ö¹q¤l¶P¥d</b></font>-¥H§¨±aªþ¥óÀɮתº¤è¦¡±H¥X¶P¥d</p>
  7. <hr>
  8. <form method=POST action=ecard.php>
  9. <div align=center>
  10. <table border=0 id=table1 style=font-size: 10pt>
  11. <tr>
  12. <td>±H¥ó¤H:</td>
  13. <td><input type=text name=fromname size=20></td>
  14. <td>±H¥ó«H½c:</td>
  15. <td><input type=text name=fromemail size=40></td>
  16. </tr>
  17. <tr>
  18. <td>¦¬¥ó¤H:</td>
  19. <td><input type=text name=toname size=20></td>
  20. <td>¦¬¥ó«H½c:</td>
  21. <td><input type=text name=toemail size=40></td>
  22. </tr>
  23. <tr>
  24. <td>°T®§:</td>
  25. <td colspan=3><textarea rows=6 name=message cols=71></textarea></td>
  26. </tr>
  27. <tr>
  28. <td>¶P¥d:</td>
  29. <td colspan=3>¡@<table border=0 width=100% id=table2>
  30. <tr>
  31. <td>
  32. <input type=radio value=2.jpg name=card checked>
  33. <img border=0 src=2.jpg width=180 height=133 align=left>
  34. </td>
  35. <td>
  36. <input type=radio value=9.jpg name=card>
  37. <img border=0 src=9.jpg width=180 height=134 align=left>
  38. </td>
  39. <td>
  40. <input type=radio name=card value=16.jpg>
  41. <img border=0 src=16.jpg width=180 height=134 align=left>
  42. </td>
  43. </tr>
  44. <tr>
  45. <td>
  46. <input type=radio name=card value=11.gif>
  47. <img border=0 src=11.gif width=180 height=136 align=left>
  48. </td>
  49. <td>
  50. <input type=radio name=card value=12.jpg>
  51. <img border=0 src=12.jpg width=180 height=134 align=left>
  52. </td>
  53. <td>
  54. <input type=radio name=crad value=20.jpg>
  55. <img border=0 src=20.jpg width=180 height=134 align=left>
  56. </td>
  57. </tr>
  58. </table>
  59. </td>
  60. </tr>
  61. <tr>
  62. <td colspan=4><input type=submit value=°e¥X¶P¥d name=B1></td>
  63. </tr>
  64. </table>
  65. </div>
  66. </form>

  67. </body>

  68. </html>
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

ecard.php
  1. <?
  2. //±µ¦¬¨Ó¦Ûªí³æªºÄæ¦ì¸ê°T
  3. $fromName=$_REQUEST["fromName"];
  4. $fromEmail=$_REQUEST["fromEmail"];
  5. $toName=$_REQUEST["toName"];
  6. $toEmail=$_REQUEST["toEmail"];
  7. $Message=$_REQUEST["message"];
  8. $Card=$_REQUEST["card"];

  9. //²©öÅçÃÒ¦¬¥ó»P±H¥ó«H½c¬O§_¥¿½T
  10. If ((!(strpos($fromEmail,'@'))) || (!(strpos($toEmail,'@'))))
  11. {
  12. //Email¤£¥¿½T¥X²{¤@­Ó¿ù»~´£¥ÜªºJavaScript°T®§µøµ¡
  13.       echo "<script>\n";
  14.       echo "alert('Sorry!!Email¶l¥ó«H½c¶ñ¼g¦³»~³á!!');\n";
  15.       echo "window.history.go(-1);\n";
  16.       echo "</script>";
  17. }
  18. Else
  19. {
  20.        //«Ø¥ß¶l±Hª«¥ó
  21.        $Mail = new COM("CDONTS.NewMail");
  22.                 $Mail->To=$toName . "<" . $toEmail . ">";
  23.                 $Mail->From=$fromName . "<" . $fromEmail . ">";
  24.                 $Mail->Subject="¨Ó¦Û" . $fromName . "ªº¯¬ºÖ¥d¤ù";
  25.                 $Mail->Body=$Message;
  26.                 //§¨±a¶P¥d¹ÏÀÉ
  27.                 $Mail->AttachFile($Card);
  28.                 $Mail->Send();
  29.        
  30.         //§iª¾¶P¥d¤w¸g±H¥X,ªð¦^¶P¥d¿ï¾Ü­¶­±       
  31.       echo "<script>\n";
  32.       echo "alert('®¥³ß§A!!¶P¥d¤w¸g¶¶§Q±H¥X!!');\n";
  33.       echo "window.location='index.htm';\n";
  34.       echo "</script>";
  35. }               
  36. ?>
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

        ÀR«ä¦Û¦b : ¦¨¥\¬OÀuÂIªºµo´§¡A¥¢±Ñ¬O¯ÊÂIªº²Ö¿n¡C
ªð¦^¦Cªí ¤W¤@¥DÃD