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

13-2-2 µ{¦¡§¹¾ã¦Cªí

13-2-2 µ{¦¡§¹¾ã¦Cªí

13-2-2   µ{¦¡§¹¾ã¦Cªí
Index.htm
  1. <html>

  2. <head>
  3. <title>¹q¤l¶P¥d-¨Ó¯¸¨ú¥d</title>
  4. </head>

  5. <body background=bg.gif>

  6. <p><font color=#800000 size=4><b>¹q¤l¶P¥d</b></font>-¨Ó¯¸¨ú¥d</p>
  7. <hr>
  8. <form method=POST action=viewcard.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=¹wÄý¥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!!

viewcard.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. ?>
  21. <html>

  22. <head>
  23. <title>¹q¤l¶P¥d-¹wÄý¶P¥d</title>
  24. </head>

  25. <body background=bg.gif>

  26. <p><font color=#800000 size=4><b>¹q¤l¶P¥d</b></font>-¹wÄý¶P¥d</p>
  27. <hr>
  28. <!--Åã¥Ü¶P¥dªº¤º®e¨Ñ¨Ï¥ÎªÌ½T»{-->
  29.         <div align=center>
  30.                 <table border=1 id=table1 style="font-size:10pt; border-collapse:collapse" bordercolor="#000080">
  31.                         <tr>
  32.                                 <td>¦¬¥ó¤H:<B><?=$toName;?></B><Br>
  33.                                 ¦¬¥ó«H½c:<B><?=$toEmail;?></B></td>
  34.                         </tr>
  35.                         <tr>
  36.                                 <td><img src="<?=$Card;?>"></td>
  37.                         </tr>
  38.                         <tr>
  39.                                 <td bgcolor="#CCFFFF"><?=nl2br($Message);?></td>
  40.                         </tr>
  41.                 </table>
  42.         </div>
  43. <!------------------------------>
  44.        
  45.         <form method=POST action=ecard.php>
  46.         <p align=center>
  47.         <!--±H°e¶P¥d¥ÎªºÁôÂÃÄæ¦ì-->
  48.         <input type=hidden name=fromName value="<?=$fromName;?>">
  49.         <input type=hidden name=fromEmail value="<?=$fromEmail;?>">
  50.         <input type=hidden name=toName value="<?=$toName;?>">
  51.         <input type=hidden name=toEmail value="<?=$toEmail;?>">
  52.         <input type=hidden name=message value="<?=$Message;?>">
  53.         <input type=hidden name=card value="<?=$Card;?>">
  54.         <!---------------------------------------->
  55.         <input type=submit value=±H¥X¥d¤ù>
  56.         <input type=button value=­×§ï¶P¥d onclick='window.history.go(-1);'></p>
  57.         </form>

  58. </body>

  59. </html>
  60. <?
  61. }
  62. ?>
½Æ»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. //³sµ²MySQL Server
  10.     $conn = mysql_connect("localhost", "root", "12345a");
  11. //¿ï¾Ü¸ê®Æ®w
  12.     mysql_select_db("ecard", $conn);
  13. //«ü©w´£¨ú¸ê®Æªº®Õ¹ï¦r¤¸ªí
  14.     mysql_query("set character set big5");
  15. //±N¶P¥d¸ê®Æ¼g¤J¸ê®Æ®w
  16. $SQL="Insert Into cardinfo (fromname,fromemail,toname,toemail,message,card) values(
  17. '$fromName','$fromEmail','$toName','$toEmail','$Message','$Card')";
  18. mysql_query($SQL);


  19. //³]©w¨Ó¯¸¨ú±o¥d¤ùªººô­¶ºô§}¦ì¸m
  20. $httpUrl=$_SERVER["SERVER_NAME"];
  21. $basUrl=$_SERVER["PHP_SELF"];
  22. $Pos=strrpos($basUrl,'/');
  23. $basUrl=substr($basUrl,0,$Pos);
  24. $CardID=mysql_insert_id($conn);
  25. $CardUrl="http://" . $httpUrl . $basUrl ."/getcard.php?CardID=" . $CardID;

  26. //Ū¨ú¥d¤ù»â¨ú³qª¾ªººô­¶¤º®e
  27. $fs=fopen("mail.htm","r");
  28. $body=fread($fs,filesize("mail.htm"));
  29. fclose($fs);

  30. //¸m´«¥d¤ù»â¨ú³qª¾«H¥óªº¤º®e
  31. $body=str_replace("{name}", $toName, $body);
  32. $body=str_replace("{email}", $toEmail, $body);
  33. $body=str_replace("{url}", $CardUrl, $body);

  34. //«Ø¤@­Ó¦W¬°$MailªºMessageª«¥ó
  35. $Mail = new COM("CDONTS.NewMail");

  36. //³]©w«H¥ó¤º®e
  37. $Mail->From=$fromEmail;
  38. $Mail->To=$toName . "<" . $toEmail . ">";
  39. $Mail->Subject=$fromName . "¬D¤F¤@±i¥d¤ù±Hµ¹§A¡A§Ö¬Ý³á¡I";
  40. $Mail->Body=$body;
  41. $Mail->BodyFormat=0;
  42. $Mail->MailFormat=0;

  43. //°e¥X«H¥ó
  44. $Mail->Send();
  45.        
  46.         //§iª¾¶P¥d¤w¸g±H¥X,ªð¦^¶P¥d¿ï¾Ü­¶­±       
  47.       echo "<script>\n";
  48.       echo "alert('®¥³ß§A!!¶P¥d¤w¸g¶¶§Q±H¥X!!');\n";
  49.       echo "window.location='index.htm';\n";
  50.       echo "</script>\n";
  51.                
  52. ?>
½Æ»s¥N½X
¤ß¦w¡A¥­¦w   
µoªí¥ô¦óµL·N¸qªº·PÁ©ÎÄé¤ô¤å³¹¤@«ß¬å,¬Ã±¤±b¸¹,½Ð¸Ô¾\ª©³W!!

TOP

getcard.php
  1. <?
  2. $CardID=$_REQUEST["CardID"];

  3. //³sµ²MySQL Server
  4.     $conn = mysql_connect("localhost", "root", "12345a");
  5. //¿ï¾Ü¸ê®Æ®w
  6.     mysql_select_db("ecard", $conn);
  7. //«ü©w´£¨ú¸ê®Æªº®Õ¹ï¦r¤¸ªí
  8.     mysql_query("set character set big5");
  9. //´£¨ú¸ê®Æ
  10. $SQL="Select * from cardinfo where cardid=" . $CardID;
  11. $RS=mysql_query($SQL);
  12. ?>
  13. <html>

  14. <head>
  15. <title>¹q¤l¶P¥d-»â¨ú¶P¥d</title>
  16. </head>

  17. <body background=bg.gif>

  18. <p><font color=#800000 size=4><b>¹q¤l¶P¥d</b></font>-»â¨ú¶P¥d</p>
  19. <hr><Center>
  20. <?
  21. if ($cardinfo=mysql_fetch_array($RS))
  22. {
  23. ?>
  24.         <div align=center>
  25.                 <table border=1 id=table1 style="font-size:10pt; border-collapse:collapse" bordercolor="#000080">
  26.                         <tr>
  27.                                 <td>±H¥ó¤H:<B><?=$cardinfo["fromname"];?></B><Br>
  28.                                 ±H¥ó«H½c:<B><?=$cardinfo["fromemail"];?></B></td>
  29.                         </tr>
  30.                         <tr>
  31.                                 <td><img src="<?=$cardinfo["card"];?>"></td>
  32.                         </tr>
  33.                         <tr>
  34.                                 <td bgcolor="#CCFFFF"><?=nl2br($cardinfo["message"]);?></td>
  35.                         </tr>
  36.                 </table>
  37.         </div>
  38. <?
  39. }
  40. Else
  41. {
  42. ?>
  43. <p align="center"><font color="#FF0000"><b>§ä¤£¨ì¥d¤ù,¦¹¶P¥d¥i¯à¤w¸g³Q§R°£¤F!!</b></font></p>
  44. <?
  45. }
  46. ?>       

  47.         <input type=button value=§Ú¤]­n±H¶P¥d onclick="window.location='index.htm'"></p>

  48. </body>

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

TOP

        ÀR«ä¦Û¦b : ¤H¥Í¤£¤@©w²y²y¬O¦n²y¡A¦ý¬O¦³¾ú½mªº±j¥´ªÌ¡AÀH®É³£¥i¥H´§´Î¡C
ªð¦^¦Cªí ¤W¤@¥DÃD