session_start();
include_once("../include/cms_admin.inc.2.php");
include_once("../include/send_mail.inc.php");
$conn = connectdb();
mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER_SET_CLIENT=utf8");
mysql_query("SET CHARACTER_SET_RESULTS=utf8");
mysql_select_db("fpsino3", $conn);
/* ~~ Start collecting ~~ */
$now = date("Y-m-d-H-i");
$name=$_POST['name'];
$tel=$_POST['tel'];
$qq=$_POST['qq'];
$comment=$_POST['comment'];
$type=$_POST['type'];
$sql = "INSERT INTO `fpi_funnel` ( `type`, `name`, `tel`, `qq`, `comment`, `date` )
VALUES ('$type', '$name', '$tel', '$qq', '$comment', '$now')";
mysql_query($sql, $conn) or die(mysql_error() . "
" . $sql);
//////////////////////////////////////////////////////////Send Mail/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//指定收件者
$to = 'itfps@fpigp.com';
//指定寄件者
$from = "cs@fpigp.com";
//指定郵件主旨
$subject = "=?utf-8?B?" . base64_encode("New funnel comment is received") . "?=";
//指定郵件內容
$message = "
CS admin,
姓名: $name
電話: $tel
QQ: $qq
留言: $comment
New funnel comment is received.
"; //建立 MIME 邊界字串 $mime_boundary = md5(uniqid(mt_rand(), TRUE)); //開啟指定的檔案 $fp = fopen($big5_file_name, "rb"); //讀取檔案內容 $data = fread($fp, filesize($big5_file_name)); //使用 MIME base64 來對 $data 編碼 $data = chunk_split(base64_encode($data)); //建立郵件標頭資訊 $header = "From: $from\r\n"; $header.= "To: $to\r\n"; $header.= "MIME-Version: 1.0\r\n"; $header.= "Content-Type: multipart/mixed; boundary=$mime_boundary\r\n"; //建立郵件內容 $content = "This is a multi-part message in MIME format.\r\n"; $content .= "--$mime_boundary\r\n"; $content .= "Content-Type: text/html; charset=utf-8\r\n"; $content .= "Content-Transfer-Encoding: 8bit\r\n\r\n"; $content .= "$message\r\n"; //傳送郵件 mail($to, $subject, $content, $header); header( 'Location: ../thanks.php' ) ; //////////////////////////////////////////////////////////Send Mail///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ?>