¡@¼ÊºÙ: ¤p»x ¡@ÀY»Î: ´¿¸g¤]¬O¤ô¹q¤u
ºÞ²zû
- ©«¤l
- 1190
- ¥DÃD
- 394
- ºëµØ
- 113
- ¿n¤À
- 1747
- ÂI¦W
- 1
- §@·~¨t²Î
- Vista
- ³nÅ骩¥»
- Office 2003
- ¾\ŪÅv
- 200
- ©Ê§O
- ¨k
- ¨Ó¦Û
- ¥xÆW
- µù¥U®É¶¡
- 2010-5-1
- ³Ì«áµn¿ý
- 2024-11-25
|
ecard.php- <?
- //±µ¦¬¨Ó¦Ûªí³æªºÄæ¦ì¸ê°T
- $fromName=$_REQUEST["fromName"];
- $fromEmail=$_REQUEST["fromEmail"];
- $toName=$_REQUEST["toName"];
- $toEmail=$_REQUEST["toEmail"];
- $Message=$_REQUEST["message"];
- $Card=$_REQUEST["card"];
- //³sµ²MySQL Server
- $conn = mysql_connect("localhost", "root", "12345a");
- //¿ï¾Ü¸ê®Æ®w
- mysql_select_db("ecard", $conn);
- //«ü©w´£¨ú¸ê®Æªº®Õ¹ï¦r¤¸ªí
- mysql_query("set character set big5");
- //±N¶P¥d¸ê®Æ¼g¤J¸ê®Æ®w
- $SQL="Insert Into cardinfo (fromname,fromemail,toname,toemail,message,card) values(
- '$fromName','$fromEmail','$toName','$toEmail','$Message','$Card')";
- mysql_query($SQL);
- //³]©w¨Ó¯¸¨ú±o¥d¤ùªººô¶ºô§}¦ì¸m
- $httpUrl=$_SERVER["SERVER_NAME"];
- $basUrl=$_SERVER["PHP_SELF"];
- $Pos=strrpos($basUrl,'/');
- $basUrl=substr($basUrl,0,$Pos);
- $CardID=mysql_insert_id($conn);
- $CardUrl="http://" . $httpUrl . $basUrl ."/getcard.php?CardID=" . $CardID;
- //Ū¨ú¥d¤ù»â¨ú³qª¾ªººô¶¤º®e
- $fs=fopen("mail.htm","r");
- $body=fread($fs,filesize("mail.htm"));
- fclose($fs);
- //¸m´«¥d¤ù»â¨ú³qª¾«H¥óªº¤º®e
- $body=str_replace("{name}", $toName, $body);
- $body=str_replace("{email}", $toEmail, $body);
- $body=str_replace("{url}", $CardUrl, $body);
- //«Ø¤@Ó¦W¬°$MailªºMessageª«¥ó
- $Mail = new COM("CDONTS.NewMail");
- //³]©w«H¥ó¤º®e
- $Mail->From=$fromEmail;
- $Mail->To=$toName . "<" . $toEmail . ">";
- $Mail->Subject=$fromName . "¬D¤F¤@±i¥d¤ù±Hµ¹§A¡A§Ö¬Ý³á¡I";
- $Mail->Body=$body;
- $Mail->BodyFormat=0;
- $Mail->MailFormat=0;
- //°e¥X«H¥ó
- $Mail->Send();
-
- //§iª¾¶P¥d¤w¸g±H¥X,ªð¦^¶P¥d¿ï¾Ü¶±
- echo "<script>\n";
- echo "alert('®¥³ß§A!!¶P¥d¤w¸g¶¶§Q±H¥X!!');\n";
- echo "window.location='index.htm';\n";
- echo "</script>\n";
-
- ?>
½Æ»s¥N½X |
|