ทำฟอร์มส่ง เมล์ แล้ว แต่ ส่ง ไม่ได้ ทำไง พอดี ทำ ฟอร์ม ส่งข้อมูล ไปที่ Email แต่ มันทำไม่ได้คับไฟล์
พอดี ทำ ฟอร์ม ส่งข้อมูล ไปที่ Email แต่ มันทำไม่ได้คับ
ไฟล์นี้ form e-mail
Code (PHP)
<?php
session_start();
if (!(isset($_SESSION['s_user'])) || empty($_SESSION['s_user'])) {
echo "<script>
alert('SystemError.Please Login');
window.location='formlogin.php';
</script>";
exit();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>FormEidtOrder : : : Manhattan</title>
<script type="text/javascript">
<!--
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<script src="Scripts/AC_RunActiveContent.js" type="text/javascript"></script><style type="text/css">
<!--
body {
background-image: url(Image/BG.jpg);
}
.style8 {font-size: 36px}
.style10 {
font-size: 24px;
color: #000000;
}
.style12 {color: #000000; }
.style13 {color: #CCCCCC}
.style14 {font-size: 24px; color: #CCCCCC; }
-->
</style></head>
<body onload="MM_preloadImages('Image/Btn/Page1_2.jpg','Image/Btn/btnProduct_2.jpg','Image/Btn/btnSale_2.jpg','Image/Btn/btnMoney_2.jpg','Image/Btn/btnLogin_2.jpg')">
<table width="200" border="0" align="center" cellpadding="0" cellspacing="0">
<tr bordercolor="#FFFFFF">
<td bordercolor="#FFFFFF"><p align="left">
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','800','height','160','src','Menu','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','wmode','transparent','movie','Menu' ); //end AC code
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="800" height="160">
<param name="movie" value="Menu.swf" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<embed src="Menu.swf" width="800" height="160" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" wmode="transparent"></embed>
</object>
</noscript>
</p>
<?php
include ("connect.php");
$username = $_SESSION['s_user'];
$sql="select * from profile where username = '$username'";
$result = mysql_query($sql) or die ('SQL error');
$row_user = mysql_fetch_array($result);
?>
<form id="form1" name="form1" method="post" action="mail.php">
<table width="572" border="1" align="center" cellpadding="5" cellspacing="2">
<tr>
<td colspan="2"><div align="center">กรุณากรอกรายละเอียดให้ครบเพื่อความสะดวกในการติดตาม
ตามรายละเอียดดังนี้
</div></td>
</tr>
<tr>
<td width="117">To :</td>
<td width="358"><input name="reci" type="text" id="reci" value="[email protected] "></td>
</tr>
<tr>
<td>Subject :</td>
<td><input name="subj" type="text" id="subj" value="ขอเปลี่ยนแปลงในการสั่งซื้อ"></td>
</tr>
<tr>
<td>From:</td>
<td><input name="from" type="text" id="from" value="<?=$row_user[6]?>"></td>
</tr>
<tr>
<td>CC :</td>
<td><input name="cc" type="text" id="cc"></td>
</tr>
<tr>
<td>BCC :</td>
<td><input name="bcc" type="text" id="bcc"></td>
</tr>
<tr>
<td>Message :</td>
<td><textarea name="mess" cols="40" rows="20" id="mess">ใส่รหัส Order ที่ได้ใน E-Mail ของท่าน
</textarea></td>
</tr>
<tr>
<td colspan="2"><div align="center">
<input type="submit" name="Submit" value="Sent E-Mail">
<input type="reset" name="Submit2" value="Reset Form">
</div></td>
</tr>
</table>
</form>
<p align="center">
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','800','height','160','src','menu2','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','border','5','wmode','transparent','movie','menu2' ); //end AC code
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="800" height="160">
<param name="movie" value="menu2.swf" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<embed src="menu2.swf" width="800" height="160" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" border="5" wmode="transparent"></embed>
</object>
</noscript>
<script type="text/javascript">
AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0','width','800','height','50','src','Image/comment','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','wmode','transparent','movie','Image/comment' ); //end AC code
</script>
<noscript>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="800" height="50">
<param name="movie" value="Image/comment.swf" />
<param name="quality" value="high" />
<param name="wmode" value="transparent" />
<embed src="Image/comment.swf" width="800" height="50" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" wmode="transparent"></embed>
</object>
</noscript>
</p></td>
</tr>
</table>
<blockquote> </blockquote>
</body>
</html>
ต่อไปนี้ืคือ mail.php
Code (PHP)
<?php
//สร้างตัวแปรใหม่เพื่อรับค่า Header
$nhead = "";
//เช็คว่า Header ตัวใดที่ทำการกรอกมาบ้าง
if (isset($_Request["from"]))
nhead .= $_Request["from"] . "\n"; // ติดตรงนี้ มันบอก
if (isset($_Request["cc"]))
nhead .= $_Request["cc"] . "\n";
if (isset($_Request["bcc"]))
nhead .= $_Request["bcc"] . "\n";
//ทำการส่ง
if $nhead != "" {
mail( $_Request["reci"], $_Request["subj"], $_Request["mess"], $nhead )
or print "ไม่สามารถส่ง E-mail ได้";
}
else {
mail( $_Request["reci"], $_Request["subj"], $_Request["mess"], )
or print "ไม่สามารถส่ง E-mail ได้";
}
?>
มัน ขึ้นอย่างนี้เลย
Parse error: syntax error, unexpected T_CONCAT_EQUAL in C:\AppServ\..........\mail.php on line 7Tag : - - - -
Date :
2009-03-25 19:30:44
By :
meraiwa
View :
1755
Reply :
2
Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in
มันคือไรหรอคับ
Date :
2009-03-25 19:55:15
By :
meraiwa
Load balance : Server 01