|
 |
|
แทรก PHP ใน HTML ไม่ได้ ..แนะนำด้วยครับ ผมแทรก PHP เล็กๆ HTML แต่ส่วนที่เป็น PHP ไม่แสดงครับ |
|
 |
|
|
 |
 |
|
เปลี่ยน สกุลไฟล์เป็น php ด้วยคับ
|
 |
 |
 |
 |
Date :
2009-09-05 10:42:55 |
By :
pjgunner |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

พี่เอี่ยว(Rest) ผมเปลี่ยนเป็น .php ก็ไม่ได้ครับ 
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
สร้างไฟล์ใหม่ เลยครับ
ตอนสร้างไฟล์ ให้เลือกเป็น php ครับ
|
 |
 |
 |
 |
Date :
2009-09-05 11:14:30 |
By :
DownsTream |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ระวังการใช้ short tag ด้วยครับ
แน่ะนำให้เขียนจาก <? ?> เป็น <?php ?>
|
 |
 |
 |
 |
Date :
2009-09-05 12:00:06 |
By :
danya |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เขาสุดยอดจริงๆ ดุนยา มองทะลุปรุโปร่ง 
|
 |
 |
 |
 |
Date :
2009-09-05 14:11:04 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ลองเขียนใหม่เป็นแบบนี้ก็ไม่ได้ครับ
//test1.html
<html>
<body>
Hi from HTML....
<?php
echo "Hi from PHP....";
?>
</body>
</html>

|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
คุณไปเขียน html เอาขึ้น server มันยังไม่ได้เลยครับ
|
 |
 |
 |
 |
Date :
2009-09-05 14:55:59 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ทำธุรกิจ http://www.aimstarnetwork.com/TH/default.htm ดีกว่าครับ มันกว่าเขียนโปรแกรม
ติดต่อ [email protected]
|
 |
 |
 |
 |
Date :
2009-09-05 15:02:21 |
By :
dank |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
มาเสริมของพี่ปลากริม
ไปเขียนนามสกุล .html
ต่อให้รอพระอาทิตย์ขึ้นทางตะวันตก ก็ยังไม่ได้เลยครับ
|
 |
 |
 |
 |
Date :
2009-09-05 15:43:48 |
By :
danya |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
"คุณไปเขียน html เอาขึ้น server มันยังไม่ได้เลยครับ"
หมายถึง ไม่สามารถเรียกไฟล์ที่นามสกุล html จาก server ได้หรือครับ
ผมไม่เข้าใจจริงๆ กรุณาอธิบายอีกนิดได้มั้ยครับ 
ขอบคุณครับ
|
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ผมอธิบายให้
ภาษา PHP ก็คือโค้ด PHP
จะสามารถประมวลผลได้ก็ต่อเมือ ไฟล์นั้นๆ มีนามสกุล .php เท่านั้น
ต่อให้เขียนโค้ด php เทพๆ 1000 กว่าบัน แต่ไปเซฟไฟล์ชื่อ index.html ไปวาง แล้วรัน โค้ด php ก็ไม่ทำงานครับ
|
 |
 |
 |
 |
Date :
2009-09-05 16:48:31 |
By :
danya |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
แรงค่ะ แรง ค่อยๆ บอกอ่ะค่ะ
คืองี้ค่ะ ถ้าเราต้องการให้แสดงข้อมูลโดยการใช้ Code PHP เราจะต้องใช้นามสกุล .php เท่านั้นค่ะ
ส่วนเรื่องการแสดงบน HTML จริงๆ เราสามารถรันโดยใช้ IE รูปแบบต่างๆ ได้ค่ะ หวังว่าคงเข้าใจนะค่ะ

|
 |
 |
 |
 |
Date :
2009-09-05 17:13:18 |
By :
gummezaka |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เรามาเริ่มกันใหม่ดีมั้ยครับ เริ่มเขียน php
|
 |
 |
 |
 |
Date :
2009-09-05 19:42:17 |
By :
lozomac |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เยี่ยมมากค่ะ คุณ A-mac
|
 |
 |
 |
 |
Date :
2009-09-05 19:49:39 |
By :
gummezaka |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
เออ ผมคอมเมนท์เอาฮาด้วยนะ
อย่าคิดมากไป 
|
 |
 |
 |
 |
Date :
2009-09-05 20:23:48 |
By :
danya |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
me too. 
|
 |
 |
 |
 |
Date :
2009-09-05 21:01:17 |
By :
plakrim |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|

|
 |
 |
 |
 |
Date :
2009-09-05 21:16:07 |
By :
gummezaka |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
 
|
 |
 |
 |
 |
Date :
2009-09-05 21:51:25 |
By :
ariya99 |
|
 |
 |
 |
 |
|
|
 |
 |
|
 |
 |
 |
|
|
 |
 |
|
ขอบคุณมากครับทุกๆท่าน
สรุปว่าผมสับสนเองที่ถูกต้องคือ
//test1.php
<HTML>
<HEAD><TITLE>การทดสอบการแทรก script php ใน html</TITLE></HEAD>
<BODY>
<H1>
<?php
echo "This is test script PHP"."<br>";
$today = date("dS F Y h:i:s A");
echo $today;
?></H1>
</BODY>
</HTML>
งง..ตรงแทรก php ใน html แทรก html ใน php 555**
|
|
|
 |
 |
|
 |
 |
|
|
|

|
Load balance : Server 03
|