<%变量%GT;在HTML模板? [英] <%variable%> in html template ??
问题描述
只是想到使用html模板页面分离
来自设计的代码。下面非常基本的例子
< html>
<! - hello.html - >
<正文>
你好< b><?php echo $ message?>< / b>< br>
< / body>
< / html>
<?php
// @ hello.php
$ message =" Phillip" ;
包括(hello.html);
?>
但我相信我已经使用了< ;%消息%GT;在
之前的html模板中,但这次它没有用。我应该在
httpd.conf中设置一些内容,以便Apache知道< %%>是PHP标签吗?
干杯
菲尔
Just playing around with the idea of using a html template page to seperate
the code from design. Very basic example below
<html>
<!-- hello.html -->
<body>
Hello <b><?php echo $message ?></b><br>
</body>
</html>
<?php
//hello.php
$message ="Phillip";
include("hello.html");
?>
However I am sure I have used <%message%> within the html template before
but this time it did not work. Is there something I should set-up in the
httpd.conf so Apache knows <% %> are PHP tags?
Cheers
Phil
推荐答案
消息?>< / b>< br>
< / body>
< / html>
<?php
// @ hello.php
message ?></b><br>
</body>
</html>
<?php
//hello.php
message =" Phillip";
包括(" hello.html");
?>
但我确信我使用了<%message%>在
之前的html模板中,但这次它没有用。我应该在
httpd.conf中设置一些内容,以便Apache知道< %%>是PHP标签吗?
干杯
菲尔
message ="Phillip";
include("hello.html");
?>
However I am sure I have used <%message%> within the html template before
but this time it did not work. Is there something I should set-up in the
httpd.conf so Apache knows <% %> are PHP tags?
Cheers
Phil
< Phil Latio写道:
Phil Latio wrote:
只是想到使用html模板页面来分离设计中的代码。下面非常基本的例子
< html>
<! - hello.html - >
< body>
您好< b>< ;?php echo
Just playing around with the idea of using a html template page to seperate
the code from design. Very basic example below
<html>
<!-- hello.html -->
<body>
Hello <b><?php echo
这篇关于<%变量%GT;在HTML模板?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!