简体   繁体   English

为什么我不能在 html 代码中嵌入我的 php 代码

[英]Why I can not embed my php code in html code

Sorry guys this is probably pretty simple, but i've been up way too late now.对不起,伙计们,这可能很简单,但我现在起得太晚了。 I have a basic html page and when i try to put any php in the body it reads it as a comment.我有一个基本的 html 页面,当我尝试将任何 php 放在正文中时,它会将其作为注释读取。

<html>
<body>
.... ....
</p>
</div>
<div id='result' class='ui-widget' style='width:70%;margin:0 auto'>
</div>
</div>
<?php 
include(WEB_ROOT.'/template/footer.php'); 
?>

</body>
</html>

Is there anything wrong?有什么问题吗?

You must use a server like Apache which interprets the page.您必须使用像 Apache 这样的服务器来解释页面。 What's more, it should have a .php extension.更重要的是,它应该有一个.php扩展名。

Problem of extension.扩展问题。 .PHP not .HTML ! .PHP 不是 .HTML! The opposite is correct !反之亦然! including html in php page包括 php 页面中的 html

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM