tag:blogger.com,1999:blog-13372656506090067972024-02-20T08:12:39.562-08:00การเขียนเว็บไชต์ ด้วยภาษา phpWeb siamhttp://www.blogger.com/profile/11283789722721632159noreply@blogger.comBlogger4125tag:blogger.com,1999:blog-1337265650609006797.post-20923473810624654592012-05-08T18:19:00.000-07:002012-05-08T18:19:31.459-07:00การส่ง mail php<pre> ฟังกชันใช้ในการส่ง mail</pre>
<pre><?
mail($strTo,$strSubject,$strMessage,$strHeader);
?></pre>
<pre>ตัวอย่าง</pre>
<pre><html>
<head>
<title>PHP Sending Email</title>
</head>
<body>
<?
$strTo = "fary_pepo@hotmail.com";//ส่งเมล์ถึงใคร
$strSubject = "Test Send Email"; //หัวข้อเมล์
$strHeader = "From:fary_pepo@hotmail.com"; //ส่งจากใคร
$strMessage = "My Body & My Description";//ข้อความที่ส่ง
$Send = @mail($strTo,$strSubject,$strMessage,$strHeader);
if($Send)
{
echo "Email Sending.";
}
else
{
echo "Email Can Not Send.";
}
?>
</body>
</html> </pre>Web siamhttp://www.blogger.com/profile/11283789722721632159noreply@blogger.com0tag:blogger.com,1999:blog-1337265650609006797.post-19272663562306342472012-05-02T20:19:00.000-07:002012-05-02T20:24:29.757-07:00การ export file excel ด้วยภาษา phpเพิ่มโค้ดนี้ลงไปส่วนบนสุดของหน้า<br />
<?<br />
header("Content-Type: application/x-msexcel"); <br />
header("content-disposition: attachment;filename=Data_bill.xls");<br />
echo "<meta http-equiv='Content-Type' content='text/html; charset=windows-874'>";<br />
?>Web siamhttp://www.blogger.com/profile/11283789722721632159noreply@blogger.com0tag:blogger.com,1999:blog-1337265650609006797.post-25460523280514782002012-04-29T23:16:00.000-07:002012-04-29T23:16:29.877-07:00<div style="color: blue;">
<b>ความรู้เบื้องต้นในการทำเว็บไซต์</b></div>
<b>1.หลักการทำงานของ WWW</b><br />
การทำงานของ www จะมีลักษณะเดียวกับการให้บริการอื่นๆ ของอินเทอร์เน็ต
คืออยู่ในรูปแบบไคลเอ็นต์-เซิร์เวอร์ (client-server)
โดยมีโปรแกรมเว็บไคลเอ็นต์ (web server) ทำหน้าที่ เป็นผู้ร้องขอบริการ
และมีโปรแกรมเว็บเซิร์ฟเวอร์ (web browser) ทำหน้าที่เป็นผู้ให้บริการ
การติดต่อระหว่างโปรแกรมเว็บบราว์เซอร์กับโปรแกรมเว็บเซิรฟเวอร์จะกระทำผ่าน
โปรดตคอล HTTP<br />
<div class="MsoNormal" style="margin: 0cm 0cm 10pt; tab-stops: 51.0pt;">
<b><span style="font-family: "Angsana New", "serif"; font-size: 16pt; line-height: 115%; mso-ascii-theme-font: major-bidi; mso-bidi-theme-font: major-bidi; mso-hansi-theme-font: major-bidi;">1.2 <span lang="TH">กลไกการทำงานของเว็บเพจ</span></span></b></div>
<div class="MsoNormal" style="margin: 0cm 0cm 10pt; tab-stops: 51.0pt;">
<span lang="TH" style="font-family: "Angsana New", "serif"; font-size: 16pt; line-height: 115%; mso-ascii-theme-font: major-bidi; mso-bidi-theme-font: major-bidi; mso-hansi-theme-font: major-bidi;"><span style="mso-tab-count: 1;"> </span>สำหรับเว็บเพจธรรมดา โดยปกติมีนามสกุลของไฟล์เป็น </span><span style="font-family: "Angsana New", "serif"; font-size: 16pt; line-height: 115%; mso-ascii-theme-font: major-bidi; mso-bidi-theme-font: major-bidi; mso-hansi-theme-font: major-bidi;">htm <span lang="TH">หรือ </span>html <span lang="TH">นั้น
เมื่อเราใช้เวบบราว์เซอร์เปิดดูเว็บเพจใด
เว็บเซิร์ฟเวอร์จะส่งเว็บเพจนั้นกลับมายังเว็บบราว์เซอร์
จากนั้นเว็บบราว์เซอร์จะแสดงผลไปตามคำสั่งภาษา </span>html <span lang="TH">ที่อยู่ในไฟล์</span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 10pt;">
<span lang="TH" style="font-family: "Angsana New", "serif"; font-size: 16pt; line-height: 115%; mso-ascii-theme-font: major-bidi; mso-bidi-theme-font: major-bidi; mso-hansi-theme-font: major-bidi;">จะเห็นได้ว่า เป็นเว็บเพจมี่มี<b>ลักษณะสแตติก </b></span><b><span style="font-family: "Angsana New", "serif"; font-size: 16pt; line-height: 115%; mso-ascii-theme-font: major-bidi; mso-bidi-theme-font: major-bidi; mso-hansi-theme-font: major-bidi;">(static)</span></b><span style="font-family: "Angsana New", "serif"; font-size: 16pt; line-height: 115%; mso-ascii-theme-font: major-bidi; mso-bidi-theme-font: major-bidi; mso-hansi-theme-font: major-bidi;"> <span lang="TH">ผู้ใช้จะพบกับเว็บเพจรูปแบบเดิมๆ ทุกครั้งที่เข้าชม จนกว่าผู้ดูแลระบบเว็บจะทำการปรับปรุงเว็บเพจนั้น นี่คือ ข้อจำกัดของภาษา </span>HTML <span lang="TH">ซึ่งเป็นภาษาที่ใช้อธิบายข้อควาบนเว็บเพจ</span></span></div>
<div class="MsoNormal" style="margin: 0cm 0cm 10pt;">
<span lang="TH" style="font-family: "Angsana New", "serif"; font-size: 16pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: major-bidi; mso-bidi-language: TH; mso-bidi-theme-font: major-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: major-bidi;">การสร้างเว็บที่มีความฉลาดว่านั้นสามารถทำได้หลายวิธี ยกตวอย่างเช่น การฝังชุดคำสั่งที่ทำงานทางฝั่งเซริร์ฟเวอร์ </span><span style="font-family: "Angsana New", "serif"; font-size: 16pt; line-height: 115%; mso-ansi-language: EN-US; mso-ascii-theme-font: major-bidi; mso-bidi-language: TH; mso-bidi-theme-font: major-bidi; mso-fareast-font-family: Calibri; mso-fareast-language: EN-US; mso-fareast-theme-font: minor-latin; mso-hansi-theme-font: major-bidi;">(server-side script)<span lang="TH">ไว้ในเวบเพจ</span></span><span style="font-family: "Angsana New","serif"; font-size: 16pt; line-height: 115%;"><span lang="TH"> การเขียน PHP</span></span></div>Web siamhttp://www.blogger.com/profile/11283789722721632159noreply@blogger.com0tag:blogger.com,1999:blog-1337265650609006797.post-15029892763168928672012-04-29T23:08:00.000-07:002012-04-29T23:08:16.190-07:00ด้วยปัจจุบันคอมพิวเตอร์ได้เข้ามามีบทบาทในการดำรงชีวิตประจำวัน ทำให้มีการพัฒนาระบบต่างๆ และเว็บไซต์ ที่ใช้เป็นสื่อในการติดต่องาน ไม่ว่าจะเป็นการซื้อขาย การพบปะพูดคุยการผ่านเว็บไซต์รวมถึงเว็บไซต์ก็เปรียบเหมือนคลังความรู้มหาศาลที่ทุกคนสามารถเข้าไปคนหาได้โดยที่ไม่ต้องเิดินทางออกไปนอกบ้าน เราจึงเล็งเห็นถึงความสำคัญของการใช้งานด้านคอมพิวเตอร์ และการพัฒนาระบบและเว็บไซต์ดังนั้น จึงขอแนะนำภาษาสักหนึ่งภาษาที่ใช้เขียน เว็บไซต์ คือ ภาษา PHP<br />
<b style="color: blue;">ประวัติความเป็นมาของ ภาษา PHP</b><br />
PHP เกิดในปี 1994 โดย Rasmus Lerdorf
โปรแกรมเมอร์อเมริกันได้คิดค้นสร้างเครื่องมือที่ใช้ในการพัฒนาเว็บส่วนตัว
ของเขา โดยใช้ข้อดีของภาษา C และ Perl เรียกว่า Personal Home Page
และได้สร้างส่วนติดต่อกับฐานข้อมูลที่ชื่อว่า Form Interpreter ( FI )
รวมทั้งสองส่วน เรียกว่า PHP/FI ซึ่งก็เป็นจุดเริ่มต้นของ PHP
มีคนที่เข้ามาเยี่ยมชมเว็บไซต์ของเขาแล้วเกิดชอบจึงติดต่อขอเอาโค้ดไปใช้
บ้าง และนำไปพัฒนาต่อ ในลักษณะของ Open Source
ภายหลังมีความนิยมขึ้นเป็นอย่างมากภายใน 3 ปีมีเว็บไซต์ที่ใช้ PHP/FI
ในติดต่อฐานข้อมูลและแสดงผลแบบ ไดนามิกและอื่นๆ มากกว่า 50000 ไซต์Web siamhttp://www.blogger.com/profile/11283789722721632159noreply@blogger.com0