https://kb.pathosting.co.th/index.php?title=Remove_BOM_(Byte_order_mark)&feed=atom&action=history
Remove BOM (Byte order mark) - Revision history
2024-03-29T08:33:40Z
Revision history for this page on the wiki
MediaWiki 1.33.0
https://kb.pathosting.co.th/index.php?title=Remove_BOM_(Byte_order_mark)&diff=499&oldid=prev
Admin at 19:49, 5 October 2012
2012-10-05T19:49:20Z
<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class="diff-marker" />
<col class="diff-content" />
<col class="diff-marker" />
<col class="diff-content" />
<tr class="diff-title" lang="en">
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">← Older revision</td>
<td colspan="2" style="background-color: #fff; color: #222; text-align: center;">Revision as of 19:49, 5 October 2012</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l9" >Line 9:</td>
<td colspan="2" class="diff-lineno">Line 9:</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div># คลิกเข้าไปตามโฟลเดอร์จนไปเจอไฟล์ที่คุณต้องการแก้ไข</div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div># คลิกเข้าไปตามโฟลเดอร์จนไปเจอไฟล์ที่คุณต้องการแก้ไข</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div># คลิกที่ Edit ตรงไฟล์ที่ต้องการแก้ไข<br/>{{fullurl:Img/2010-10-18_1732.png}}<br/><br/></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div># คลิกที่ Edit ตรงไฟล์ที่ต้องการแก้ไข<br/>{{fullurl:Img/2010-10-18_1732.png}}<br/><br/></div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div># คุณจะเห็นว่ามีอักขระแปลกๆ แทรกอยู่ที่หัวไฟล์ (มันคือ BOM)<br/>{{fullurl:Img/2010-10-18_1735.png}}<br/><br/></div></td><td class='diff-marker'>+</td><td style="color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div># คุณจะเห็นว่ามีอักขระแปลกๆ แทรกอยู่ที่หัวไฟล์ (มันคือ BOM)<br/>{{fullurl:Img/2010-10-18_1735.png}}<ins class="diffchange diffchange-inline"><br/><br/><b style="color:red;">หมายเหตุ:</b> ในกรณีที่ Encoding ของ Browser เป็น UTF-8 คุณจะมองไม่เห็นอักขระดังกล่าว แต่คุณสามารถลบมันออกได้เหมือนกัน โดยคลิกที่บรรทัดแรก แล้วกดคีย์ [Home] บนคีย์บอร์ด เพื่อเลื่อน Cursor ไปที่ด้านหน้าสุดของบรรทัด แล้วให้กดคีย์ [Del] บนคีย์บอร์ด เพื่อลบอักขระ BOM ออก</ins><br/><br/></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div># ให้ลบออกอักขระดังกล่าวออกครับ<br/>{{fullurl:Img/2010-10-18_1737.png}}<br/><br/></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div># ให้ลบออกอักขระดังกล่าวออกครับ<br/>{{fullurl:Img/2010-10-18_1737.png}}<br/><br/></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div># กดปุ่ม Save As ที่ด้านล่าง<br/>{{fullurl:Img/2010-10-18_1738.png}}<br/><br/></div></td><td class='diff-marker'> </td><td style="background-color: #f8f9fa; color: #222; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;"><div># กดปุ่ม Save As ที่ด้านล่าง<br/>{{fullurl:Img/2010-10-18_1738.png}}<br/><br/></div></td></tr>
</table>
Admin
https://kb.pathosting.co.th/index.php?title=Remove_BOM_(Byte_order_mark)&diff=165&oldid=prev
Admin: Created page with "Category:PHP โปรแกรม Editor บางตัว เวลาเราบันทึกไฟล์เป็น UTF-8 ตัวโปรแกรมจะแท..."
2010-10-18T10:39:29Z
<p>Created page with "<a href="/Category:PHP" title="Category:PHP">Category:PHP</a> โปรแกรม Editor บางตัว เวลาเราบันทึกไฟล์เป็น UTF-8 ตัวโปรแกรมจะแท..."</p>
<p><b>New page</b></p><div>[[Category:PHP]]<br />
โปรแกรม Editor บางตัว เวลาเราบันทึกไฟล์เป็น UTF-8 ตัวโปรแกรมจะแทรก BOM (Byte order mark) เอาไว้ที่ส่วนหัวของไฟล์ด้วย ทำให้มีปัญหากับโปรแกรม PHP พวกคำสั่ง '''header''' และ '''session_start''' เพราะว่าก่อนเรียก 2 คำสั่งนี้ จะต้องไม่มี output ที่ออกมาก่อนเลย ถ้ามี BOM มาแทรกที่ตอนแรก ก็จะทำให้เกิด Error ลักษณะนี้<br />
<font color="red">Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent <br />
(output started at /home/username/domains/username.com/public_html/index.php:1) in /home/username/domains/username.com/public_html/index.php on line 9</font><br />
<br />
วิธีแก้ คือ ต้องลบ BOM ที่หัวไฟล์ออกครับ. แต่ถ้าใช้ Editor ทั่วๆ ไป บางทีจะมองไม่เห็นครับ วิธีที่ได้ผล 100% คือ ให้ใช้ File Manager ใน DirectAdmin มาแก้ครับ ซึ่งมีขั้นตอนดังนี้ครับ<br />
<br />
# เปิด DirectAdmin เข้าที่เมนู File Manager<br />
# คลิกเข้าไปตามโฟลเดอร์จนไปเจอไฟล์ที่คุณต้องการแก้ไข<br />
# คลิกที่ Edit ตรงไฟล์ที่ต้องการแก้ไข<br/>{{fullurl:Img/2010-10-18_1732.png}}<br/><br/><br />
# คุณจะเห็นว่ามีอักขระแปลกๆ แทรกอยู่ที่หัวไฟล์ (มันคือ BOM)<br/>{{fullurl:Img/2010-10-18_1735.png}}<br/><br/><br />
# ให้ลบออกอักขระดังกล่าวออกครับ<br/>{{fullurl:Img/2010-10-18_1737.png}}<br/><br/><br />
# กดปุ่ม Save As ที่ด้านล่าง<br/>{{fullurl:Img/2010-10-18_1738.png}}<br/><br/></div>
Admin