Register Register Member Login Member Login Member Login Forgot Password ??
PHP , ASP , ASP.NET, VB.NET, C#, Java , jQuery , Android , iOS , Windows Phone
 

Registered : 109,027

HOME > PHP > PHP Forum > สอบถามเรืองเขียนโค้ด ส่ง Email หน้าเว็บหน่อยครับ กด submit แล้วมันส่งไม่ได้ไม่รู้เขียนผิดตรงไหน



 

สอบถามเรืองเขียนโค้ด ส่ง Email หน้าเว็บหน่อยครับ กด submit แล้วมันส่งไม่ได้ไม่รู้เขียนผิดตรงไหน

 



Topic : 076527



โพสกระทู้ ( 43 )
บทความ ( 0 )



สถานะออฟไลน์




โค้ด form
Code (html)
                			<html>
                            <head>
                            
                            <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
                            </head>
                            <body>		
                                    <table border='0' cellspacing='0' cellpadding='0' class='FormCaptionBorderBg ContentCaption_header'>
<tr>
<td><b>แจ้งการชำระเงิน</b></td>
</tr>
</table>
<table border='0' cellspacing='0' cellpadding='0' class='FormBorder ContentCaption_detail'>
<tr>
<td>

<table border='0' cellspacing='5' cellpadding='0' class='ContentCaption_detail'>
<input type='hidden' name='lang' value='th'>
<tr>
<td class='FormTextLeft'>ชื่อ-สกุล :</td>
<td>
<input type='text' name='name' maxlength='200' size='40' value=""> <font class='FormFieldRequest'>*</font>	 </td>
</tr>

<tr>
<td class='FormTextLeft'>อีเมลล์ :</td>
<td>
<input type='text' name='emailp' maxlength='200' size='40' value="" onKeypress="check_email();"> <font class='FormFieldRequest'>*</font>	 </td>
</tr>
<tr>
<td class='FormTextLeft'>เบอร์โทรศัพท์ :</td>
<td>
<input type='text' name='phone' maxlength='200' size='40' value="" onKeypress="check_number();"> <font class='FormFieldRequest'>*</font>	 </td>
</tr>
<tr>
<td colspan="2">
<div style='padding-bottom: 5px;'><b><u>ชำระเงินเข้าบัญชี</u></b></div><table border='0' cellspacing='0' cellpadding='0' class='TableLine' width='100%'><tr align='center'><td align='left' id='TableLineCaption' nowrap>&nbsp; </td><td align='left' id='TableLineCaption' nowrap>ธนาคาร</td><td align='left' id='TableLineCaption' nowrap>ประเภทบัญชี</td><td align='left' id='TableLineCaption' nowrap>สาขา</td><td id='TableLineCaption' nowrap>เลขที่บัญชี</td></tr><tr align='center'><td align='left'><input type='radio' name='bank' checked value='bkb' ></td> <td align='left'><table border='0' cellspacing='0' cellpadding='0'><tr><td id='TableLineBottomNoLine' style='padding-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px;'>ธนาคารกรุงเทพ</td></tr></table></td><td align='left'>สะสมทรัพย์</td><td align='left'>&nbsp;</td><td>&nbsp;</td>
</tr><tr align='center'><td align='left'><input type='radio' name='bank' checked value='scb' ></td> <td align='left'><table border='0' cellspacing='0' cellpadding='0'><tr><td id='TableLineBottomNoLine' style='padding-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px;'>ธนาคารไทยพาณิชย์</td></tr></table></td><td align='left'>ออมทรัพย์</td><td align='left'>&nbsp;</td><td>&nbsp;</td>
</tr><tr align='center'><td align='left'><input type='radio' name='bank' checked value='tfb' ></td> <td align='left'><table border='0' cellspacing='0' cellpadding='0'><tr><td id='TableLineBottomNoLine' style='padding-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px;'>ธนาคารกสิกรไทย</td></tr></table></td><td align='left'>ออมทรัพย์</td><td align='left'>&nbsp;</td><td>&nbsp;</td>
</tr></table>
<font class='FormFieldRequest'>*</font>	 </td>
</tr>
<tr>
<td class='FormTextLeft'>จำนวนเงิน :</td>
<td><input type='text' name='Subtotal' maxlength='200' size='10' value="" > 
<font class='FormFieldRequest'>*</font>	 </td>
</tr>
<tr>
<td class='FormTextLeft'>วันที่ชำระเงิน :</td>
<td><input type='text' name='Subtotal' maxlength='200' size='10' value="" >
*
</td>
</tr>
<tr>
<td class='FormTextLeft'>เวลาโอนเงิน :</td>
<td>
<input name="time" type="text" size="1" maxlength="2" /> : <input name="time" type="text" size="1" maxlength="2" />
<font class='FormFieldRequest'></font>	* </td>
</tr>
<tr valign='top'>
<td class='FormTextLeft'>หมายเหตุ :</td>
<td nowrap>	
<textarea name='description' id='description' cols='50' rows='6' wrap='VIRTUAL'></textarea> 
<font class='FormFieldRequest'></font>	 </td>
</tr>
<tr valign='top'>
<td class='FormTextLeft'>สินค้าที่สั่ง :</td>
<td><form name="form" id="form">
  <select name="jumpMenu" id="jumpMenu" onchange="MM_jumpMenu('parent',this,0)">
    <option>คลอโรฟิลล์(ขวดใหญ่)</option>
    <option>คลอโรฟิลล์(ขวดกลาง)</option>
    <option>คลอโรฟิลล์(แพ็คคู่)</option>
    <option>แองเจิ้ล</option>
  </select>
</form>
 </td>
</tr>
<tr>
<td>&nbsp;</td>
<td>
<form name="submit" method="post" action="mail.php">
  <label>
    <input type="submit" name="submit" id="submit" value="Submit" />
  </label>
</form></td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>





นี้โค้ด php ไฟล์ mail.php
Code (PHP)
<?
$to = "[email protected]"; 
$subject = "แจ้งการโอนเงิน";
$header = "แจ้งการโอนเงิน";
$name = $_POST['name'];
$emailp = $_POST['emailp'];
$phone = $_POST['phone'];
$bank = $_POST['bank'];
$Subtotal = $_POST['Subtotal'];
$time = $_POST['time'];
$description = $_POST['description'];
$jumpMenu = $_POST['jumpMenu'];

if (mail($to,$subject,$header,$name,$emailp,$phone,$bank,$Subtotal,$time,$description,$jumpMenu)){
echo "ส่งเมล์เรียบร้อยแล้ว";
}else{
echo "ไม่สามารถส่งเมล์ได้";
}
?>




Tag : PHP, HTML/CSS, CakePHP









ประวัติการแก้ไข
2012-04-02 15:13:34
2012-04-02 15:14:01
2012-04-02 15:14:49
2012-04-02 15:24:54
Move To Hilight (Stock) 
Send To Friend.Bookmark.
Date : 2012-04-02 15:12:26 By : beautiful View : 2325 Reply : 9
 

 

No. 1



โพสกระทู้ ( 3,748 )
บทความ ( 0 )

สมาชิกที่ใส่เสื้อไทยครีเอท Hall of Fame 2012

สถานะออฟไลน์
Facebook

<form name="submit" method="post" action="mail.php">
81.
<label>
82.
<input type="submit" name="submit" id="submit" value="Submit" />
83.
</label>
84.</form>

มีอยู่แค่นี้หรอครับ แล้วมันจะเอาอะไรส่งล่ะ ครอบฟอร์มให้ถูกครับ






แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-04-02 15:19:41 By : Dragons_first
 


 

No. 2



โพสกระทู้ ( 43 )
บทความ ( 0 )



สถานะออฟไลน์


ตอบความคิดเห็นที่ : 1 เขียนโดย : Dragons_first เมื่อวันที่ 2012-04-02 15:19:41
รายละเอียดของการตอบ ::
ครอบตรงไหนบ้างอ่าครับพอดีผมลองครอบสุ่มๆดูแล้ว กด submit มันก็ไม่ทำงานอ่าครับ

ผมเคยเอาลองไปไว้ใต้ ล่าง บรรทัด 7 12 และ 16 ก็ยังไม่ได้อ่าครับ



ประวัติการแก้ไข
2012-04-02 15:33:26
2012-04-02 15:33:32
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-04-02 15:32:58 By : beautiful
 

 

No. 3



โพสกระทู้ ( 2,311 )
บทความ ( 1 )



สถานะออฟไลน์


ต้องครอบทั้งแต่เทเบิ้ลที่สองอ่ะครับ ประมาณว่า
Code (PHP)
                			<html>
                            <head>
                            
                            <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
                            </head>
                            <body>		
                                    <table border='0' cellspacing='0' cellpadding='0' class='FormCaptionBorderBg ContentCaption_header'>
<tr>
<td><b>แจ้งการชำระเงิน</b></td>
</tr>
</table>
<table border='0' cellspacing='0' cellpadding='0' class='FormBorder ContentCaption_detail'>
<tr>
<td>

<form name="submit" method="post" action="mail.php">
<table border='0' cellspacing='5' cellpadding='0' class='ContentCaption_detail'>
<input type='hidden' name='lang' value='th'>
<tr>
<td class='FormTextLeft'>ชื่อ-สกุล :</td>
<td>
<input type='text' name='name' maxlength='200' size='40' value=""> <font class='FormFieldRequest'>*</font>	 </td>
</tr>

<tr>
<td class='FormTextLeft'>อีเมลล์ :</td>
<td>
<input type='text' name='emailp' maxlength='200' size='40' value="" onKeypress="check_email();"> <font class='FormFieldRequest'>*</font>	 </td>
</tr>
<tr>
<td class='FormTextLeft'>เบอร์โทรศัพท์ :</td>
<td>
<input type='text' name='phone' maxlength='200' size='40' value="" onKeypress="check_number();"> <font class='FormFieldRequest'>*</font>	 </td>
</tr>
<tr>
<td colspan="2">
<div style='padding-bottom: 5px;'><b><u>ชำระเงินเข้าบัญชี</u></b></div><table border='0' cellspacing='0' cellpadding='0' class='TableLine' width='100%'><tr align='center'><td align='left' id='TableLineCaption' nowrap>&nbsp; </td><td align='left' id='TableLineCaption' nowrap>ธนาคาร</td><td align='left' id='TableLineCaption' nowrap>ประเภทบัญชี</td><td align='left' id='TableLineCaption' nowrap>สาขา</td><td id='TableLineCaption' nowrap>เลขที่บัญชี</td></tr><tr align='center'><td align='left'><input type='radio' name='bank' checked value='bkb' ></td> <td align='left'><table border='0' cellspacing='0' cellpadding='0'><tr><td id='TableLineBottomNoLine' style='padding-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px;'>ธนาคารกรุงเทพ</td></tr></table></td><td align='left'>สะสมทรัพย์</td><td align='left'>&nbsp;</td><td>&nbsp;</td>
</tr><tr align='center'><td align='left'><input type='radio' name='bank' checked value='scb' ></td> <td align='left'><table border='0' cellspacing='0' cellpadding='0'><tr><td id='TableLineBottomNoLine' style='padding-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px;'>ธนาคารไทยพาณิชย์</td></tr></table></td><td align='left'>ออมทรัพย์</td><td align='left'>&nbsp;</td><td>&nbsp;</td>
</tr><tr align='center'><td align='left'><input type='radio' name='bank' checked value='tfb' ></td> <td align='left'><table border='0' cellspacing='0' cellpadding='0'><tr><td id='TableLineBottomNoLine' style='padding-left: 0px; padding-top: 0px; padding-right: 5px; padding-bottom: 0px;'>ธนาคารกสิกรไทย</td></tr></table></td><td align='left'>ออมทรัพย์</td><td align='left'>&nbsp;</td><td>&nbsp;</td>
</tr></table>
<font class='FormFieldRequest'>*</font>	 </td>
</tr>
<tr>
<td class='FormTextLeft'>จำนวนเงิน :</td>
<td><input type='text' name='Subtotal' maxlength='200' size='10' value="" > 
<font class='FormFieldRequest'>*</font>	 </td>
</tr>
<tr>
<td class='FormTextLeft'>วันที่ชำระเงิน :</td>
<td><input type='text' name='Subtotal' maxlength='200' size='10' value="" >
*
</td>
</tr>
<tr>
<td class='FormTextLeft'>เวลาโอนเงิน :</td>
<td>
<input name="time" type="text" size="1" maxlength="2" /> : <input name="time" type="text" size="1" maxlength="2" />
<font class='FormFieldRequest'></font>	* </td>
</tr>
<tr valign='top'>
<td class='FormTextLeft'>หมายเหตุ :</td>
<td nowrap>	
<textarea name='description' id='description' cols='50' rows='6' wrap='VIRTUAL'></textarea> 
<font class='FormFieldRequest'></font>	 </td>
</tr>
<tr valign='top'>
<td class='FormTextLeft'>สินค้าที่สั่ง :</td>
<td>
  <select name="jumpMenu" id="jumpMenu" onChange="MM_jumpMenu('parent',this,0)">
    <option>คลอโรฟิลล์(ขวดใหญ่)</option>
    <option>คลอโรฟิลล์(ขวดกลาง)</option>
    <option>คลอโรฟิลล์(แพ็คคู่)</option>
    <option>แองเจิ้ล</option>
  </select>
 </td>
</tr>
<tr>
<td>&nbsp;</td>
<td>

  <label>
    <input type="submit" name="submit" id="submit" value="Submit" />
  </label>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
</body>
</html>



ลองดูครับว่าได้ป่าว?
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-04-02 15:53:41 By : arm8957
 


 

No. 4



โพสกระทู้ ( 43 )
บทความ ( 0 )



สถานะออฟไลน์


ตอบความคิดเห็นที่ : 3 เขียนโดย : arm8957 เมื่อวันที่ 2012-04-02 15:53:41
รายละเอียดของการตอบ ::
กด submit ได้แล้วครับแต่ว่า
ส่งไม่ได้ชะงั้นไปทำงานส่วนนี่อ่าครับ โค้ดผิดตรงไหนหรอครับ
else{
echo "ไม่สามารถส่งเมล์ได้";}

ส่งไม่ได้ชะงั้นเลย

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-04-02 16:02:25 By : beautiful
 


 

No. 5



โพสกระทู้ ( 2,311 )
บทความ ( 1 )



สถานะออฟไลน์


ลอง Bug ดูนะครับ
ไฟล์ mail.php
<?
print_r($_POST); #ใช้คำสั่งนี้เพื่อดูว่า form ส่งค่าอะไรมาบ้าง

$to = "[email protected]"; 
$subject = "แจ้งการโอนเงิน";
$header = "แจ้งการโอนเงิน";
$name = $_POST['name'];
$emailp = $_POST['emailp'];
$phone = $_POST['phone'];
$bank = $_POST['bank'];
$Subtotal = $_POST['Subtotal'];
$time = $_POST['time'];
$description = $_POST['description'];
$jumpMenu = $_POST['jumpMenu'];

if (mail($to,$subject,$header,$name,$emailp,$phone,$bank,$Subtotal,$time,$description,$jumpMenu)){
echo "ส่งเมล์เรียบร้อยแล้ว";
}else{
echo "ไม่สามารถส่งเมล์ได้";
}
?>

แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-04-02 16:19:23 By : arm8957
 


 

No. 6



โพสกระทู้ ( 43 )
บทความ ( 0 )



สถานะออฟไลน์


ตอบความคิดเห็นที่ : 5 เขียนโดย : arm8957 เมื่อวันที่ 2012-04-02 16:19:23
รายละเอียดของการตอบ ::
นี้ครับผม

นี้แบบข้อควาทครับผม
Array ( [lang] => th [name] => 1 [emailp] => 1 [phone] => 1 [bank] => tfb [Subtotal] => 1 [time] => 1 [description] => 1 [jumpMenu] => เธ„เธฅเธญเน‚เธฃเธŸเธดเธฅเธฅเนŒ(เธ‚เธงเธ”เนƒเธซเธเนˆ) [submit] => Submit )



เน„เธกเนˆเธชเธฒเธกเธฒเธฃเธ–เธชเนˆเธ‡เน€เธกเธฅเนŒเน„เธ”เน‰

//ผมลองใส่ค่า 1 ทุกช่องเลยนะครับผม



ประวัติการแก้ไข
2012-04-02 16:25:50
2012-04-02 16:26:56
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-04-02 16:24:44 By : beautiful
 


 

No. 7



โพสกระทู้ ( 2,311 )
บทความ ( 1 )



สถานะออฟไลน์


ทดสอบกับ Localhost หรือเซิร์ฟเวอร์จิงครับ ถ้า Localhost ต้องเปิดฟังก์ชั่นส่งเมล์ก่อนนะครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-04-02 16:34:43 By : arm8957
 


 

No. 8



โพสกระทู้ ( 43 )
บทความ ( 0 )



สถานะออฟไลน์


เชิฟเวอร์จริงครับ
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-04-02 16:38:19 By : beautiful
 


 

No. 9



โพสกระทู้ ( 43 )
บทความ ( 0 )



สถานะออฟไลน์


เป็นเพราะไรหรอครับทำไมมันไม่ทำงาน
แสดงความคิดเห็นโดยอ้างถึง ความคิดเห็นนี้
Date : 2012-04-02 20:40:17 By : beautiful
 

   

ค้นหาข้อมูล


   
 

แสดงความคิดเห็น
Re : สอบถามเรืองเขียนโค้ด ส่ง Email หน้าเว็บหน่อยครับ กด submit แล้วมันส่งไม่ได้ไม่รู้เขียนผิดตรงไหน
 
 
รายละเอียด
 
ตัวหนา ตัวเอียง ตัวขีดเส้นใต้ ตัวมีขีดกลาง| ตัวเรืองแสง ตัวมีเงา ตัวอักษรวิ่ง| จัดย่อหน้าอิสระ จัดย่อหน้าชิดซ้าย จัดย่อหน้ากึ่งกลาง จัดย่อหน้าชิดขวา| เส้นขวาง| ขนาดตัวอักษร แบบตัวอักษร
ใส่แฟลช ใส่รูป ใส่ไฮเปอร์ลิ้งค์ ใส่อีเมล์ ใส่ลิ้งค์ FTP| ใส่แถวของตาราง ใส่คอลัมน์ตาราง| ตัวยก ตัวห้อย ตัวพิมพ์ดีด| ใส่โค้ด ใส่การอ้างถึงคำพูด| ใส่ลีสต์
smiley for :lol: smiley for :ken: smiley for :D smiley for :) smiley for ;) smiley for :eek: smiley for :geek: smiley for :roll: smiley for :erm: smiley for :cool: smiley for :blank: smiley for :idea: smiley for :ehh: smiley for :aargh: smiley for :evil:
Insert PHP Code
Insert ASP Code
Insert VB.NET Code Insert C#.NET Code Insert JavaScript Code Insert C#.NET Code
Insert Java Code
Insert Android Code
Insert Objective-C Code
Insert XML Code
Insert SQL Code
Insert Code
เพื่อความเรียบร้อยของข้อความ ควรจัดรูปแบบให้พอดีกับขนาดของหน้าจอ เพื่อง่ายต่อการอ่านและสบายตา และตรวจสอบภาษาไทยให้ถูกต้อง

อัพโหลดแทรกรูปภาพ

Notice

เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ
อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง

   
  เพื่อความปลอดภัยและการตรวจสอบ กระทู้ที่แทรกไฟล์อัพโหลดไฟล์จากที่อื่น อาจจะถูกลบทิ้ง
 
โดย
อีเมล์
บวกค่าให้ถูก
<= ตัวเลขฮินดูอารบิก เช่น 123 (หรือล็อกอินเข้าระบบสมาชิกเพื่อไม่ต้องกรอก)







Exchange: นำเข้าสินค้าจากจีน, Taobao, เฟอร์นิเจอร์, ของพรีเมี่ยม, ร่ม, ปากกา, power bank, แฟลชไดร์ฟ, กระบอกน้ำ

Load balance : Server 02
ThaiCreate.Com Logo
© www.ThaiCreate.Com. 2003-2024 All Rights Reserved.
ไทยครีเอทบริการ จัดทำดูแลแก้ไข Web Application ทุกรูปแบบ (PHP, .Net Application, VB.Net, C#)
[Conditions Privacy Statement] ติดต่อโฆษณา 081-987-6107 อัตราราคา คลิกที่นี่