|
|
|
ถามเรื่อการส่ง mail โดย IE กับ firefox ไม่ได้ค่ะ แต่ chrome ค่ะ รบกวนด้วยนะคะ |
|
|
|
|
|
|
|
เขียน php แล้วส่งเมลจาก IE กับ firefox ไม่ได้ค่ะ ได้แต่เวลาส่งผ่าน chrome ค่ะ ต้องทำยังไงคะ
มีไฟล์ 2 ไฟล์ค่ะ ไฟล์แรกเป็น index.php ไฟล์ที่ 2 เป็นไฟล์ reserve.php ค่ะ
Code (PHP)
<html>
<head>
<title>RESERVATION MAIN PAGE</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
a {
cursor: pointer;
}
.fill {
color:#654545;
font:"Myriad Pro", "Myriad Pro Cond", "Myriad Pro Light";
}
#content {background-image:url(images/background.gif);}
p { font-size: 100%; padding-left: 220px; padding-top:5px}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<!-- Save for Web Slices (RESERVATION MAIN PAGE.psd) -->
<form action="reserve.php" method="post" name="reserve">
<table width="800" height="601" border="0" align="center" cellpadding="0" cellspacing="0" id="content">
<tr>
<td colspan="5" width="422" height="53" alt="" class="topic"><img src="images/reserve_01.gif"></td>
<td rowspan="18" width="197" height="600" alt="">
</td>
<td rowspan="2"><a href="home.php"><img src="images/reserve_03.gif" width="181" height="81" alt=""></a></td>
</tr>
<tr>
<td rowspan="16"> </td>
<td colspan="4" width="397" height="28" alt=""><img src="images/reserve_05.gif"></td>
</tr>
<tr>
<td colspan="3" class="fill" width="340" height="28"><input name="name" type="text" width="340" /></td>
<td rowspan="15" width="57" height="454" alt="">
</td>
<td rowspan="16" width="181" height="519" alt="">
</td>
</tr>
<tr>
<td colspan="3" width="340" height="27" alt="" class="normal" ><img src="images/reserve_09.gif">
</td>
</tr>
<tr>
<td colspan="3"width="340" height="28" alt="" class="fill"><input name="tel" type="tel"width="340" /></td>
</tr>
<tr>
<td colspan="3" width="340" height="28" alt="" class="normal" ><img src="images/reserve_11.gif">
</td>
</tr>
<tr>
<td colspan="3" width="340" height="28" alt="" class="fill"><input name="email" type="email" width="340" /></td>
</tr>
<tr>
<td colspan="3" width="340" height="27" alt="" class="normal"><img src="images/reserve_13.gif">
</td>
</tr>
<tr>
<td colspan="3" width="340" height="28" alt="" class="fill"><input name="ver_email" type="email" width="340" /></td>
</tr>
<tr>
<td colspan="3" width="340" height="26" alt="" class="normal"><img src="images/reserve_15.gif">
</td>
</tr>
<tr>
<td colspan="3" width="340" height="28" alt="" class="fill"><input name="dd" type="date" width="340" /></td>
</tr>
<tr>
<td colspan="3" width="340" height="27" alt="" class="normal"><img src="images/reserve_17.gif">
</td>
</tr>
<tr>
<td colspan="3" width="340" height="28" alt="" class="fill"><input name="tt" type="time" width="340" /></td>
</tr>
<tr>
<td colspan="3" width="340" height="27" alt="" class="normal"><img src="images/reserve_19.gif">
</td>
</tr>
<tr>
<td colspan="3" width="340" height="28" alt="" class="fill"><input name="num" type="number"width="340" /></td>
</tr>
<tr>
<td colspan="3" width="340" height="27" alt="" class="normal"><img src="images/reserve_21.gif">
</td>
</tr>
<tr>
<td colspan="3" width="340" height="69" alt="" class="fill"><textarea name="req" cols="40" rows="4"></textarea>
</td>
</tr>
<tr>
<td colspan="2" width="30" height="65" alt="">
</td>
<td width="127" height="65" alt=""><input type="image" name="Submit" value="Submit" src="images/submit_26.gif" alt="Button">
</td>
<td colspan="2" width="265" height="65" alt="" class="footer"><img src="images/reserve_25.gif">
</td>
</tr>
<tr>
<td>
<img src="images/spacer.gif" width="25" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="5" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="127" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="208" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="57" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="197" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="181" height="1" alt=""></td>
</tr>
</table>
</form>
<!-- End Save for Web Slices -->
</body>
</html>
reserve.php
Code (PHP)
<?php
if(isset($_POST['Submit'])){
$name = $_POST['name'];
$email1 = $_POST['email'];
$ver_email1 = $_POST['ver_email'];
$tel = $_POST['tel'];
$dd = $_POST['dd'];
$tt = $_POST['tt'];
$num = $_POST['num'];
$req = $_POST['req'];
//$to = "[email protected],[email protected],[email protected]";
$to = "[email protected],[email protected],[email protected]";
if(empty($name) ){
?>
<script type="text/javascript">
alert("Please Add your name");
history.back();
</script>
<?php
} else if(empty($email1)) {
?>
<script type="text/javascript">
alert("Please Add your email");
history.back();
</script>
<?php
} else if(empty($ver_email1)) {
?>
<script type="text/javascript">
alert("Please verify your email");
history.back();
</script>
<?php
} else if(empty($tel)) {
?>
<script type="text/javascript">
alert("Please Add your Telephone Number");
history.back();
</script>
<?php
}
else{
if($email1!=""){
$email = $email1;
}else {
$email = "-";
}
if($ver_email1!=""){
$ver_email = $ver_email1;
}else {
$ver_email = "-";
}
if ($email!=$ver_email){
?>
<script type="text/javascript">
alert("Please check your verify email");
history.back();
</script>
<?php }
else {
/*
@mail($to,"From: $name <$email>","Tel: $tel", "Date: $dd", "Time: $tt", "Number of Guest: $num", "Special Request: $req");
*/
$subject = "Reserve From ".$name;
$message = " From : " . $name. " Tel. : ".$tel." Email: ".$email. " Date : " .$dd. " Time : ". $tt." Number of Guest: ".$num . " Special Request: ".$req ;
//mail ($to,$subject,$message);
if(mail($to,$subject,$message)){
?>
<script type="text/javascript">
alert("Thank for Contact Us");
history.back();
</script>
<?php
}else {
?>
<script type="text/javascript">
alert("Can't send mail");
history.back();
</script>
<?php
}
}
}
}
?>
Tag : PHP, HTML/CSS, JavaScript, Windows, Mac
|
ประวัติการแก้ไข 2012-10-17 16:42:43
|
|
|
|
|
Date :
2012-10-17 15:54:20 |
By :
Mminnano |
View :
1119 |
Reply :
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ทำได้แล้วค่ะ :)
|
|
|
|
|
Date :
2012-10-17 16:43:19 |
By :
Mminnano |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ตกลงเป็นเพราะอะไรครับ
|
|
|
|
|
Date :
2012-10-18 09:25:29 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
เดี๋ยวลงอันใหม่ให้ดูค่ะ เพราะแก้อยู่นาน เขียนใหม่เลย 55555 แต่เท่าที่ดูคร่าวๆ อาจจะเป็นเพราะ วงเล็บเกินค่ะ
index.php
Code (PHP)
<html>
<head>
<title>RESERVATION MAIN PAGE</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css">
a {
cursor: pointer;
}
.fill {
color:#654545;
font:"Myriad Pro", "Myriad Pro Cond", "Myriad Pro Light";
}
#content {background-image:url(images/background.gif);}
p { font-size: 100%; padding-left: 220px; padding-top:5px}
</style>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<!-- Save for Web Slices (RESERVATION MAIN PAGE.psd) -->
<form action="reserve.php" method="post" name="reserve">
<table width="800" height="601" border="0" align="center" cellpadding="0" cellspacing="0" id="content">
<tr>
<td colspan="5" width="422" height="53" alt="" class="topic"><img src="images/reserve_01.gif"></td>
<td rowspan="18" width="197" height="600" alt="">
</td>
<td rowspan="2"><a href="home.php"><img src="images/reserve_03.gif" width="181" height="81" alt=""></a></td>
</tr>
<tr>
<td rowspan="16"> </td>
<td colspan="4" width="397" height="28" alt=""><img src="images/reserve_05.gif"></td>
</tr>
<tr>
<td colspan="3" class="fill" width="340" height="28"><input name="name" type="text" width="340" /></td>
<td rowspan="15" width="57" height="454" alt="">
</td>
<td rowspan="16" width="181" height="519" alt="">
</td>
</tr>
<tr>
<td colspan="3" width="340" height="27" alt="" class="normal" ><img src="images/reserve_09.gif">
</td>
</tr>
<tr>
<td colspan="3"width="340" height="28" alt="" class="fill"><input name="tel" type="tel"width="340" /></td>
</tr>
<tr>
<td colspan="3" width="340" height="28" alt="" class="normal" ><img src="images/reserve_11.gif">
</td>
</tr>
<tr>
<td colspan="3" width="340" height="28" alt="" class="fill"><input name="email" type="email" width="340" /></td>
</tr>
<tr>
<td colspan="3" width="340" height="27" alt="" class="normal"><img src="images/reserve_13.gif">
</td>
</tr>
<tr>
<td colspan="3" width="340" height="28" alt="" class="fill"><input name="ver_email" type="email" width="340" /></td>
</tr>
<tr>
<td colspan="3" width="340" height="26" alt="" class="normal"><img src="images/reserve_15.gif">
</td>
</tr>
<tr>
<td colspan="3" width="340" height="28" alt="" class="fill"><input name="dd" type="date" width="340" /></td>
</tr>
<tr>
<td colspan="3" width="340" height="27" alt="" class="normal"><img src="images/reserve_17.gif">
</td>
</tr>
<tr>
<td colspan="3" width="340" height="28" alt="" class="fill"><input name="tt" type="time" width="340" /></td>
</tr>
<tr>
<td colspan="3" width="340" height="27" alt="" class="normal"><img src="images/reserve_19.gif">
</td>
</tr>
<tr>
<td colspan="3" width="340" height="28" alt="" class="fill"><input name="num" type="number"width="340" /></td>
</tr>
<tr>
<td colspan="3" width="340" height="27" alt="" class="normal"><img src="images/reserve_21.gif">
</td>
</tr>
<tr>
<td colspan="3" width="340" height="69" alt="" class="fill"><textarea name="req" cols="40" rows="4"></textarea>
</td>
</tr>
<tr>
<td colspan="2" width="30" height="65" alt="">
</td>
<td width="127" height="65" alt=""><input type="submit" name="submit" value="submit" src="images/submit_26.gif" />
</td>
<td colspan="2" width="265" height="65" alt="" class="footer"><img src="images/reserve_25.gif">
</td>
</tr>
<tr>
<td>
<img src="images/spacer.gif" width="25" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="5" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="127" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="208" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="57" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="197" height="1" alt=""></td>
<td>
<img src="images/spacer.gif" width="181" height="1" alt=""></td>
</tr>
</table>
</form>
<!-- End Save for Web Slices -->
</body>
</html>
reserve.php
Code (PHP)
<?php
// ชื่อไฟล์ reserve.php เพื่อรับค่าจาก form
$name = $_POST['name'];
$email1 = $_POST['email'];
$ver_email1 = $_POST['ver_email'];
$tel = $_POST['tel'];
$dd = $_POST['dd'];
$tt = $_POST['tt'];
$num = $_POST['num'];
$req = $_POST['req'];
if(empty($name) ){
?>
<script type="text/javascript">
alert("Please Add your name");
history.back();
</script>
<?php
} else if(empty($email1)) {
?>
<script type="text/javascript">
alert("Please Add your email");
history.back();
</script>
<?php
} else if(empty($ver_email1)) {
?>
<script type="text/javascript">
alert("Please verify your email");
history.back();
</script>
<?php
} else if(empty($tel)) {
?>
<script type="text/javascript">
alert("Please Add your Telephone Number");
history.back();
</script>
<?php
}
else{
if($email1!=""){
$email = $email1;
}else {
$email = "-";
}
if($ver_email1!=""){
$ver_email = $ver_email1;
}else {
$ver_email = "-";
}
if ($email!=$ver_email){
?>
<script type="text/javascript">
alert("Please check your verify email");
history.back();
</script>
<?php }
else {
/*
@mail($to,"From: $name <$email>","Tel: $tel", "Date: $dd", "Time: $tt", "Number of Guest: $num", "Special Request: $req");
$subject = "Reserve From ".$name;
$message = " From : " . $name. " Tel. : ".$tel." Email: ".$email. " Date : " .$dd. " Time : ". $tt." Number of Guest: ".$num . " Special Request: ".$req ;
//mail ($to,$subject,$message);
*/
//$MailTo = "[email protected],[email protected],[email protected]";
$MailTo = "[email protected],[email protected],[email protected]";
//$MailTo = "[email protected],[email protected]";
$MailFrom = $_POST['email'];
$MailSubject = "Reserve From ".$name; ;
$message = " From : " . $name. " Tel. : ".$tel." Email: ".$email. " Date : " .$dd. " Time : ". $tt." Number of Guest: ".$num . " Special Request: ".$req ;
$MailMessage = $message ;
$Headers = "MIME-Version: 1.0\r\n" ;
$Headers .= "Content-type: text/html; charset=windows-874\r\n" ;
// ส่งข้อความเป็นภาษาไทย ใช้ "windows-874"
$Headers .= "From: ".$MailFrom." <".$MailFrom.">\r\n" ;
$Headers .= "Reply-to: ".$MailFrom." <".$MailFrom.">\r\n" ;
$Headers .= "X-Priority: 3\r\n" ;
$Headers .= "X-Mailer: PHP mailer\r\n" ;
if(mail($MailTo, $MailSubject , $MailMessage, $Headers, $MailFrom))
{
?>
<script type="text/javascript">
alert("Thank for Contact Us");
window.location.href = "http://www.bonjourbangkok.com/home.php";
</script>
<?php
}else {
?>
<script type="text/javascript">
alert("Can't send mail");
history.back();
</script>
<?php
}
}
}
?>
|
|
|
|
|
Date :
2012-10-18 11:21:15 |
By :
Mminnano |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 02
|