คือผมจะโชว์หน้าเวบบอร์ดหน้า แรกแต่ ไฟล์หน้าแรกมันดันเป็นนามสกุล *.tpl
โค้ดเดิม ในไฟล์ www.authgw.login.form.tpl
<html>
<head>
<title>Redirect to Login Page </title>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<link href="css/style.css" rel="stylesheet" type="text/css">
</head>
<body background="images/bg.gif" bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<table id="Table_01" border="0" width="780" cellpadding="0" cellspacing="0" align="center">
<tr>
<td colspan=3> </td>
</tr>
<tr>
<td width="15%"><img src="images/img_05.gif" width="22" height="21" alt=""></td>
<td background="images/img_06.gif" width="82%"><img src="images/img_06.gif" width="25" height="21" alt=""></td>
<td width="3%"><img src="images/img_08.gif" width="20" height="21" alt=""></td>
</tr>
<tr valign="top">
<td background="images/img_13.gif" width="15%" height="485"><img src="images/img_10.gif" width="22" height="366" alt=""></td>
<td width="82%" bgcolor="white" height="485">
<META HTTP-EQUIV="Cache-Control" content="no-cache">
<META HTTP-EQUIV="Pragma" CONTENT="no-cache">
<div align="center">
<div>{$message}</div>
<FORM method="POST" action="{$action}{$popup}">
<p align="left"><img src="login-images/banner_logo.jpg" width="930" height="268"><br>
<br>
.<font color="#FFFFFF"> ........</font><font face="MS Sans Serif" color="#0000FF"><b><font color="#330000">Entertain
<font color="#FFFFFF">.</font>Servics</font></b></font><font face="MS Sans Serif" color="#FFFFFF">.</font><font color="#FFFFFF">.............................................</font><font face="MS Sans Serif">Username:
</font>
<INPUT type="text" name="txt_username" size="25" maxlength="50" tabindex="1">
<br>
<font color="#FFFFFF">.............<font face="MS Sans Serif">..</font></font><font face="MS Sans Serif" color="#CC9966">
</font><font face="MS Sans Serif"><font color="#CC9966"><a href="movics.html" target="_blank">Movics
piecture</a></font><font color="#FFFFFF">. .</font></font><font color="#FFFFFF">.....................................
.... ...</font><font face="MS Sans Serif">Password:</font>
<INPUT type="password" name="txt_password" size="25" maxlength="50" tabindex="2">
<br>
.<font color="#FFFFFF">.............. </font><font color="#CC9966" face="MS Sans Serif"><a href="music.html" target="_blank">Music</a>.</font><font color="#FFFFFF" face="MS Sans Serif">..</font><font color="#FFFFFF">.......................................................................................</font>
<INPUT type="submit" name="sm_login" value="Login" tabindex="3">
<input name="uri_host" value="{$uri_host}" type="hidden">
<input name="uri_path" value="{$uri_path}" type="hidden">
<br>
<font color="#FFFFFF">...............<font face="MS Sans Serif" color="#000000">
</font></font><font color="#CC9966" face="MS Sans Serif"><a href="software.html" target="_blank">Software</a></font><font color="#FFFFFF">....
....................................................................</font><br>
<font color="#FFFFFF">...............</font><font face="MS Sans Serif" color="#CC9966">
</font><font face="MS Sans Serif"><font color="#CC9966"><a href="games.html" target="_blank">Games</a></font>
</font><br>
.<font color="#FFFFFF">.................................................................................</font><a href="../webboard/webboard.php?Category=mos_wifi"><font face="MS Sans Serif">บอร์ดแจ้งปัญหาการใช้งาน
และแสดงความคิดเห็นต่าง ๆ </font> </a> </p>
</FORM>
</div>
</td>
<td background="images/img_14.gif" width="3%" height="485"><img src="images/img_12.gif" width="20" height="369" alt=""></td>
</tr>
<tr>
<td width="15%"><img src="images/img_15.gif" width="22" height="17" alt=""></td>
<td background="images/img_16.gif" width="82%"><img src="images/img_16.gif" width="23" height="17" alt=""></td>
<td width="3%"><img src="images/img_18.gif" width="20" height="17" alt=""></td>
</tr>
</table>
</body>
</html>
คือมันไม่สามารถแทรก php ได้ครับ ต้องแทรกคำสั่งตามนี้อย่างไรครับ
<? include('../webboard/show10.php');
showTopboard('show10',10);
?>
ขอบพระคุณมากครับ
แทรก php ลงใน *.tpl
Moderators: mindphp, ผู้ดูแลกระดาน
- mindphp
- ผู้ดูแลระบบ MindPHP
- Posts: 27222
- Joined: 22/09/2008 6:18 pm
- Contact:
Re: แทรก php ลงใน *.tpl
จุดประสงค์ ของ template file คือ แยก php ออก จาก html
ถ้าจะใส่ คำสั่ง php ต้องใส่ ที่ไฟล์ php ที่เรียกใช้ template นั้นๆ แล้วกำหนด ตำแหน่งที่ต้องการแสดงใน template file เพิ่มเอาเองครับ
ถ้าจะใส่ คำสั่ง php ต้องใส่ ที่ไฟล์ php ที่เรียกใช้ template นั้นๆ แล้วกำหนด ตำแหน่งที่ต้องการแสดงใน template file เพิ่มเอาเองครับ
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
-
- PHP Newbie
- Posts: 2
- Joined: 26/10/2008 7:31 pm
Re: แทรก php ลงใน *.tpl
อยากเห็นตัวอย่างครับ
- mindphp
- ผู้ดูแลระบบ MindPHP
- Posts: 27222
- Joined: 22/09/2008 6:18 pm
- Contact:
Re: แทรก php ลงใน *.tpl
รูปแบบการเขียน ขึ้นอยู่กับ template engine ที่ท่านใช้ ครับ
ตามตัวอย่างไฟล์ที่ยกมา เช่น
ตามตัวอย่างไฟล์ที่ยกมา เช่น
Code: Select all
<div>{$message}</div>
<FORM method="POST" action="{$action}{$popup}">
ติดตาม VDO: http://www.youtube.com/c/MindphpVideoman
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
ติดตาม FB: https://www.facebook.com/pages/MindphpC ... 9517401606
หมวดแชร์ความรู้: https://www.mindphp.com/forums/viewforum.php?f=29
รับอบรม และพัฒนาระบบ: https://www.mindphp.com/forums/viewtopic.php?f=6&t=2042
-
- Similar Topics
- Replies
- Views
- Last post
-
-
แทรก Icon ใน Office 365
by teenproza7 » 27/05/2019 10:54 am » in Microsoft Office Knowledge & line & Etc - 0 Replies
- 655 Views
-
Last post by teenproza7
27/05/2019 10:54 am
-
-
-
แทรก video บน powerpoint 2010 พร้อมการใช้งาน ปุ่ม control
by M004 » 09/07/2013 3:14 pm » in ถาม - ตอบ คอมพิวเตอร์ - 0 Replies
- 1271 Views
-
Last post by M004
09/07/2013 3:14 pm
-
-
-
วิธีเรียกใช้ไฟล์ CSS และ Js ลงใน Extension ของ Joomla
by Patipat » 10/07/2019 5:07 pm » in Joomla Developing Knowledge - 0 Replies
- 344 Views
-
Last post by Patipat
10/07/2019 5:07 pm
-
-
- 0 Replies
- 2138 Views
-
Last post by Panchalee
24/01/2018 7:02 pm
Who is online
Users browsing this forum: Google [Bot] and 14 guests